Question about nmethod flushing

Coleen Phillimore coleen.phillimore at
Tue Aug 12 22:12:49 UTC 2014

I have a question about nmethod flushing wrt to RedefineClasses (no, no, 
no, please keep reading!)

When we redefine a class, there is code to deoptimize the methods, and 
make them non-entrant.   Non-entrant methods are still considered alive, 
so for class redefinition we walk the code cache so that we don't delete 
the metadata for any methods while some nmethod is still referring to 
it.   Eventually the sweeper will come along and mark the methods as 
zombies so we don't have to deal with them anymore, but for class 
redefinition, can we force methods to go to zombie's earlier?  Or make 
the sweeper more aggressive after a class redefinition?

This code cache walking isn't that expensive, but we keep around a lot 
of metadata as a result that could be more eagerly deleted.


More information about the hotspot-compiler-dev mailing list