Blame SOURCES/8164293-pr3412-rh1459641.patch

045ef6
# HG changeset patch
045ef6
# User jcm
045ef6
# Date 1484137609 28800
045ef6
#      Wed Jan 11 04:26:49 2017 -0800
045ef6
# Node ID 1faf7c17089922f6f72b580253725f2ecb6ba2f8
045ef6
# Parent  3d07e14d65bc223dbfe94be9224e4aa8c6e63762
045ef6
8164293, PR3412, RH1459641: HotSpot leaking memory in long-running requests
045ef6
Summary: Applied RMs in sweep_code_cache and related codes.
045ef6
Reviewed-by: kvn, thartmann
045ef6
045ef6
diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp
045ef6
--- openjdk/hotspot/src/share/vm/code/nmethod.cpp
045ef6
+++ openjdk/hotspot/src/share/vm/code/nmethod.cpp
045ef6
@@ -1172,6 +1172,7 @@
045ef6
 // Clear ICStubs of all compiled ICs
045ef6
 void nmethod::clear_ic_stubs() {
045ef6
   assert_locked_or_safepoint(CompiledIC_lock);
045ef6
+  ResourceMark rm;
045ef6
   RelocIterator iter(this);
045ef6
   while(iter.next()) {
045ef6
     if (iter.type() == relocInfo::virtual_call_type) {
045ef6
diff --git a/src/share/vm/runtime/sweeper.cpp b/src/share/vm/runtime/sweeper.cpp
045ef6
--- openjdk/hotspot/src/share/vm/runtime/sweeper.cpp
045ef6
+++ openjdk/hotspot/src/share/vm/runtime/sweeper.cpp
045ef6
@@ -319,6 +319,7 @@
045ef6
 }
045ef6
 
045ef6
 void NMethodSweeper::sweep_code_cache() {
045ef6
+  ResourceMark rm;
045ef6
   Ticks sweep_start_counter = Ticks::now();
045ef6
 
045ef6
   _flushed_count                = 0;
045ef6
@@ -626,6 +627,7 @@
045ef6
 // state of the code cache if it's requested.
045ef6
 void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
045ef6
   if (PrintMethodFlushing) {
045ef6
+    ResourceMark rm;
045ef6
     stringStream s;
045ef6
     // Dump code cache state into a buffer before locking the tty,
045ef6
     // because log_state() will use locks causing lock conflicts.
045ef6
@@ -643,6 +645,7 @@
045ef6
   }
045ef6
 
045ef6
   if (LogCompilation && (xtty != NULL)) {
045ef6
+    ResourceMark rm;
045ef6
     stringStream s;
045ef6
     // Dump code cache state into a buffer before locking the tty,
045ef6
     // because log_state() will use locks causing lock conflicts.