Profile Image
vishnupriya

What is JVM startup parameter: -XX:+SegmentedCodeCache?

What is JVM startup parameter: -XX:+SegmentedCodeCache? Have you used this JVM arguement before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-segmentedcodecache

  • x-segmentedcodecache

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:

 

The option “-XX:[+|-]SegmentedCodeCache” allows you to enable/disable the use a segmented code cache.

 

Since:

 

Starting from JDK 9.

 

Examples:

 

This will instruct JVM to enable the use of segmented code cache:

 

-XX:+SegmentedCodeCache

 

Description:

 

JVM stores the generated native code in an area of memory organized as a single heap which is called code cache. Instead of having only one single code heap, the code cache is separated into three segments non-method, profiled method, and non-profiled method code (See. table). The flag “SegmentedCodeCache” allows you to enable or disable the segmentation of the code cache. Without the option “-XX:+SegmentedCodeCache”, the code cache consists of one large segment. With it, we will have the three discussed segments above. These segments aren’t resized at runtime.

 

 

Default Value:

 

By default, this option is disabled.

 

Note:

 

The feature is enabled by default if tiered compilation is enabled (-XX:+TieredCompilation ) and -XX:ReservedCodeCacheSize >= 240 MB. The advantages are better control of the memory footprint, reduced code fragmentation, and better iTLB/iCache behavior due to improved locality. iTLB/iCache is a CPU-specific term meaning Instruction Translation Lookaside Buffer (ITLB). ICache is an instruction cache in theCPU. The implementation of the code cache can be found in the file: “/share/vm/code/codeCache.cpp”

 

Arguments related:

 

NonNMethodCodeHeapSize, NonProfiledCodeHeapSize, ProfiledCodeHeapSize, TieredCompilation

 

Related Posts:

 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-segmentedcodecache

  • x-segmentedcodecache

  • JVM startup parameter