Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/sweeper.cpp @ 941:8b46c4d82093
4957990: Perm heap bloat in JVM
Summary: Treat ProfileData in MDO's as a source of weak, not strong, roots. Fixes the bug for stop-world collection -- the case of concurrent collection will be fixed separately.
Reviewed-by: jcoomes, jmasa, kvn, never
author | ysr |
---|---|
date | Wed, 02 Sep 2009 00:04:29 -0700 |
parents | a61af66fc99e |
children | 89e0543e1737 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
940:8624da129f0b | 941:8b46c4d82093 |
---|---|
123 // If it is first time, we see nmethod then we mark it. Otherwise, | 123 // If it is first time, we see nmethod then we mark it. Otherwise, |
124 // we reclame it. When we have seen a zombie method twice, we know that | 124 // we reclame it. When we have seen a zombie method twice, we know that |
125 // there are no inline caches that referes to it. | 125 // there are no inline caches that referes to it. |
126 if (nm->is_marked_for_reclamation()) { | 126 if (nm->is_marked_for_reclamation()) { |
127 assert(!nm->is_locked_by_vm(), "must not flush locked nmethods"); | 127 assert(!nm->is_locked_by_vm(), "must not flush locked nmethods"); |
128 if (PrintMethodFlushing && Verbose) { | |
129 tty->print_cr("### Nmethod 0x%x (marked for reclamation) being flushed", nm); | |
130 } | |
128 nm->flush(); | 131 nm->flush(); |
129 } else { | 132 } else { |
133 if (PrintMethodFlushing && Verbose) { | |
134 tty->print_cr("### Nmethod 0x%x (zombie) being marked for reclamation", nm); | |
135 } | |
130 nm->mark_for_reclamation(); | 136 nm->mark_for_reclamation(); |
131 _rescan = true; | 137 _rescan = true; |
132 } | 138 } |
133 } else if (nm->is_not_entrant()) { | 139 } else if (nm->is_not_entrant()) { |
134 // If there is no current activations of this method on the | 140 // If there is no current activations of this method on the |
135 // stack we can safely convert it to a zombie method | 141 // stack we can safely convert it to a zombie method |
136 if (nm->can_not_entrant_be_converted()) { | 142 if (nm->can_not_entrant_be_converted()) { |
143 if (PrintMethodFlushing && Verbose) { | |
144 tty->print_cr("### Nmethod 0x%x (not entrant) being made zombie", nm); | |
145 } | |
137 nm->make_zombie(); | 146 nm->make_zombie(); |
138 _rescan = true; | 147 _rescan = true; |
139 } else { | 148 } else { |
140 // Still alive, clean up its inline caches | 149 // Still alive, clean up its inline caches |
141 nm->cleanup_inline_caches(); | 150 nm->cleanup_inline_caches(); |
144 // long time we don't want to keep rescanning at every safepoint. | 153 // long time we don't want to keep rescanning at every safepoint. |
145 _not_entrant_seen_on_stack++; | 154 _not_entrant_seen_on_stack++; |
146 } | 155 } |
147 } else if (nm->is_unloaded()) { | 156 } else if (nm->is_unloaded()) { |
148 // Unloaded code, just make it a zombie | 157 // Unloaded code, just make it a zombie |
149 if (nm->is_osr_only_method()) { | 158 if (PrintMethodFlushing && Verbose) |
159 tty->print_cr("### Nmethod 0x%x (unloaded) being made zombie", nm); | |
160 if (nm->is_osr_method()) { | |
150 // No inline caches will ever point to osr methods, so we can just remove it | 161 // No inline caches will ever point to osr methods, so we can just remove it |
151 nm->flush(); | 162 nm->flush(); |
152 } else { | 163 } else { |
153 nm->make_zombie(); | 164 nm->make_zombie(); |
154 _rescan = true; | 165 _rescan = true; |