diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp index 6ea39aea98dbdbfbd159aa6b235f4f784fc8b2c2..cbfeba1e7191351cac3c0439bf73daf226354e6b 100644 --- a/src/share/vm/code/nmethod.cpp +++ b/src/share/vm/code/nmethod.cpp @@ -1151,6 +1151,7 @@ void nmethod::clear_inline_caches() { // Clear ICStubs of all compiled ICs void nmethod::clear_ic_stubs() { assert_locked_or_safepoint(CompiledIC_lock); + ResourceMark rm; RelocIterator iter(this); while(iter.next()) { if (iter.type() == relocInfo::virtual_call_type) { diff --git a/src/share/vm/runtime/sweeper.cpp b/src/share/vm/runtime/sweeper.cpp index b4954ff861559b6f7b07712c970359b150d140ee..ba4ce2da2bc72b14a0a68c2b178be3fde6d01d2b 100644 --- a/src/share/vm/runtime/sweeper.cpp +++ b/src/share/vm/runtime/sweeper.cpp @@ -319,6 +319,7 @@ void NMethodSweeper::possibly_sweep() { } void NMethodSweeper::sweep_code_cache() { + ResourceMark rm; Ticks sweep_start_counter = Ticks::now(); _flushed_count = 0; @@ -626,6 +627,7 @@ int NMethodSweeper::process_nmethod(nmethod *nm) { // state of the code cache if it's requested. void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { if (PrintMethodFlushing) { + ResourceMark rm; stringStream s; // Dump code cache state into a buffer before locking the tty, // because log_state() will use locks causing lock conflicts. @@ -643,6 +645,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { } if (LogCompilation && (xtty != NULL)) { + ResourceMark rm; stringStream s; // Dump code cache state into a buffer before locking the tty, // because log_state() will use locks causing lock conflicts.