request for review (m): 4957990: Perm heap bloat in JVM

Y.S.Ramakrishna at Sun.COM Y.S.Ramakrishna at Sun.COM
Wed Aug 5 16:57:53 PDT 2009

Can there be a situation where an osr nmethod associated
with a method oop gets unloaded while the method and its
class are still alive? I see that happening with my workspace
with the changes for 4957990 (yet to figure out why the osr
nmethod was unloaded).

Shortly after said unload, the sweeper flushes the nmethod,
but the nmethod is still left linked off of the klass's _osr_nmethod_head
list, and a subsequent invocation counter overflow at a bci does
an osr nmethod lookup and falls foul of the flushed nmethod left
in the instanceKlass's osr nmethod head.

So I have two questions:

(a) can an osr nmethod be unloaded while its klass is still alive ?
(b) if the answer to (a) is yes, then we need to take special steps
     (not present in current code) to unlink said nmethod from the
     list of osr nmethods in its klass.

Am I making sense? Otherwise i can provide more direct detail.
(I am still digging to find out why we decided to unload the
nmethod and will have more follow-up info in a subsequent email.)

-- ramki

More information about the hotspot-gc-dev mailing list