8164293: HotSpot leaking memory in long-running requests

Wed, 11 Jan 2017 04:26:49 -0800

author
jcm
date
Wed, 11 Jan 2017 04:26:49 -0800
changeset 8964
77e13f15e396
parent 8954
9deaba76a094
child 8965
98e7171e0372

8164293: HotSpot leaking memory in long-running requests
Summary: Applied RMs in sweep_code_cache and related codes.
Reviewed-by: kvn, thartmann

src/share/vm/code/nmethod.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/sweeper.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/code/nmethod.cpp	Tue Mar 21 12:20:10 2017 -0700
     1.2 +++ b/src/share/vm/code/nmethod.cpp	Wed Jan 11 04:26:49 2017 -0800
     1.3 @@ -1151,6 +1151,7 @@
     1.4  // Clear ICStubs of all compiled ICs
     1.5  void nmethod::clear_ic_stubs() {
     1.6    assert_locked_or_safepoint(CompiledIC_lock);
     1.7 +  ResourceMark rm;
     1.8    RelocIterator iter(this);
     1.9    while(iter.next()) {
    1.10      if (iter.type() == relocInfo::virtual_call_type) {
     2.1 --- a/src/share/vm/runtime/sweeper.cpp	Tue Mar 21 12:20:10 2017 -0700
     2.2 +++ b/src/share/vm/runtime/sweeper.cpp	Wed Jan 11 04:26:49 2017 -0800
     2.3 @@ -319,6 +319,7 @@
     2.4  }
     2.5  
     2.6  void NMethodSweeper::sweep_code_cache() {
     2.7 +  ResourceMark rm;
     2.8    Ticks sweep_start_counter = Ticks::now();
     2.9  
    2.10    _flushed_count                = 0;
    2.11 @@ -626,6 +627,7 @@
    2.12  // state of the code cache if it's requested.
    2.13  void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
    2.14    if (PrintMethodFlushing) {
    2.15 +    ResourceMark rm;
    2.16      stringStream s;
    2.17      // Dump code cache state into a buffer before locking the tty,
    2.18      // because log_state() will use locks causing lock conflicts.
    2.19 @@ -643,6 +645,7 @@
    2.20    }
    2.21  
    2.22    if (LogCompilation && (xtty != NULL)) {
    2.23 +    ResourceMark rm;
    2.24      stringStream s;
    2.25      // Dump code cache state into a buffer before locking the tty,
    2.26      // because log_state() will use locks causing lock conflicts.

mercurial