[jboss-dev-forums] [Design of JBoss Profiler] - Re: About Kill -3 signal
yimianshisan
do-not-reply at jboss.com
Thu Jun 21 03:40:28 EDT 2007
Thank you Clerbert!
I know the execution can be controlled by MBean well, it's really a better way.
But what I want to know is the principle of the signal handle. I have tried to define my own signal handling method in jbossInspector.cc. as following:
void signalStartProfiler(int signum)
{
if (profilerRunning>=0) {
initProfiler();
} else {
printMessageError();
}
}
and in the JVM_onLoad() method, I added the following code:
signal(SIGUSR1,signalStartProfiler);
Now I can send signal kill -10 to the process. the profiling now can be started, but the process is dead. When I delete the following code in method initProfile,every thing is OK.
if (profileMemory)
{
jvmpi_interface->DisableEvent(JVMPI_EVENT_OBJECT_ALLOC, NULL);
jvmpi_interface->DisableEvent(JVMPI_EVENT_OBJECT_FREE, NULL);
}
It is interesting, but I don't know why. when I define my own signal handle,what the JVM had done?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056301#4056301
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056301
More information about the jboss-dev-forums
mailing list