Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211150

G1 Full GC not purging code root memory and hence causing memory leak

    XMLWordPrintable

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b14

      Backports

        Description

        G1 Full GC does not purge code root memory, and that causes a memory leak. The leak is illustrated in the attached file after_8141421_fix.png.

        I made the following simple change that purges the code root memory
        in the Full GC control path. With this change this leak goes away. (see attached file after_purge_fix.png)
        --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
        +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
        @@ -1423,6 +1423,7 @@
                 hot_card_cache->reset_card_counts();
                 hot_card_cache->reset_hot_cache();
               }
        + purge_code_root_memory();
          
               // Rebuild remembered sets of all regions.
               if (G1CollectedHeap::use_parallel_gc_threads()) {

        We currently purge code root memory in VM_G1IncCollectionPause operation but not in VM_G1CollectFull which is causing this leak.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                poonam Poonam Bajaj Parhar
                Reporter:
                poonam Poonam Bajaj Parhar
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: