提交 417a55c1 编写于 作者: J jcm

8164293: HotSpot leaking memory in long-running requests

Summary: Applied RMs in sweep_code_cache and related codes.
Reviewed-by: kvn, thartmann
上级 497a9cfd
...@@ -1151,6 +1151,7 @@ void nmethod::clear_inline_caches() { ...@@ -1151,6 +1151,7 @@ void nmethod::clear_inline_caches() {
// Clear ICStubs of all compiled ICs // Clear ICStubs of all compiled ICs
void nmethod::clear_ic_stubs() { void nmethod::clear_ic_stubs() {
assert_locked_or_safepoint(CompiledIC_lock); assert_locked_or_safepoint(CompiledIC_lock);
ResourceMark rm;
RelocIterator iter(this); RelocIterator iter(this);
while(iter.next()) { while(iter.next()) {
if (iter.type() == relocInfo::virtual_call_type) { if (iter.type() == relocInfo::virtual_call_type) {
......
...@@ -319,6 +319,7 @@ void NMethodSweeper::possibly_sweep() { ...@@ -319,6 +319,7 @@ void NMethodSweeper::possibly_sweep() {
} }
void NMethodSweeper::sweep_code_cache() { void NMethodSweeper::sweep_code_cache() {
ResourceMark rm;
Ticks sweep_start_counter = Ticks::now(); Ticks sweep_start_counter = Ticks::now();
_flushed_count = 0; _flushed_count = 0;
...@@ -626,6 +627,7 @@ int NMethodSweeper::process_nmethod(nmethod *nm) { ...@@ -626,6 +627,7 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
// state of the code cache if it's requested. // state of the code cache if it's requested.
void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
if (PrintMethodFlushing) { if (PrintMethodFlushing) {
ResourceMark rm;
stringStream s; stringStream s;
// Dump code cache state into a buffer before locking the tty, // Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts. // because log_state() will use locks causing lock conflicts.
...@@ -643,6 +645,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { ...@@ -643,6 +645,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
} }
if (LogCompilation && (xtty != NULL)) { if (LogCompilation && (xtty != NULL)) {
ResourceMark rm;
stringStream s; stringStream s;
// Dump code cache state into a buffer before locking the tty, // Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts. // because log_state() will use locks causing lock conflicts.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册