Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Java Memory Pool what is the replacement of Code Cache replacement in JAVA 11?

Tags:

java

jvm

mbeans

I see the following questions relevant - how-is-the-java-memory-pool-divided and garbage-collection-not-running-for-code-cache-memory-pool but I donot have the relevant answers.

As you see via Jconsole there is no more Code Cache available in the Memory pool, Need some details on what is its replacement and where can we find more details about the change?

enter image description here

like image 287
Narendran Solai Sridharan Avatar asked Mar 03 '23 02:03

Narendran Solai Sridharan


1 Answers

I believe the restructuring came with Java 9.

Instead of having a single code heap, the code cache was segmented into distinct code heaps, each of which contains compiled code of a particular type. Such a design enables to separate code with different properties.

The main idea was to improve performance and enable future extensions.

There are three different top-level types of compiled code:

  • JVM internal (non-method) code
  • Profiled-code
  • Non-profiled code

The corresponding code heaps are:

  • A non-method code heap containing non-method code, such as compiler buffers and bytecode interpreter. This code type will stay in the code cache forever.

  • A profiled code heap containing lightly optimized, profiled methods with a short lifetime.

  • A non-profiled code heap containing fully optimized, non-profiled methods with a potentially long lifetime.

You can find some useful details (like motivation to this restructuring, how to configure new heaps, etc.) in JEP-197 :)

like image 149
ikos23 Avatar answered Mar 05 '23 17:03

ikos23