tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Memory leak detection and JVMTI
Date Thu, 22 Apr 2010 09:43:40 GMT
Just a short note: I stumbled over the "ForceGarbageCollection" JVMTI 
function today. It reliably triggers a full GC and the call only returns 
after having run the GC. It will do so, even when System.gc() is 
disabled. It looks like it doesn't respect ExplicitGCInvokesConcurrent, 
so it will always do a stop-the-world collection leading to possibly 
long stop times but also to defragmented tenured space.

As always, it is not expected, that the finalizers will be run.

Maybe something we could add to tcnative. Since the call is stateless, 
adding it should be simple, just implementing Agent_OnLoad to initialize 
the JVMTI environmnt using GetEnv() and then making 
ForceGarbageCollection(env) publicly accessible. One must also register 
the JVMTi agent using e.g. the "-agentlib" startup option.

I don't know, whether that would lead to a problem with duplicate 
library loading, in which case one would have to separate it from tcnative.

Caution: this is all form looking at docs and code, no tests done yet.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message