开发者

How to send signal to JVM created by JNI_CreateJavavm call?

开发者 https://www.devze.com 2022-12-11 07:29 出处:网络
Is there any possibility that I can directly send signal to a Java virtual machine which is created by calling JVM_CreateJavavm in native C/C++ code?

Is there any possibility that I can directly send signal to a Java virtual machine which is created by calling JVM_CreateJavavm in native C/C++ code?

e.g.:

For a normal Java process, say its pid is 12345, I can send a signal 3 to it like this ... kill -3 12345, and hopefully I could trigger javacore or heapdump by changing JVM configurations.

However if the JVM is created thru JNI API and wrapped inside a C/C++ application, on开发者_StackOverflowly the native process's PID is visible, in that case if I send signal to that process, the whole process is just terminated and seems the JVM cannot receive the signal at all.

Thanks in advance ...


No. There is no separate process for the JVM. The JVM is just running in the process that called it. I don't think that Sun documents a way to use those signal handlers via the invocation interface.


http://www.scribd.com/doc/13119378/If-JNI-based-application-is-crashing-check-signal-handling

0

精彩评论

暂无评论...
验证码 换一张
取 消