3

I was monitoring the javaDB(derby) using jconsole, my java version is 1.6.0_27.

As I read in this article, CodeCache is full. Compiler has been disabled:

  • I thought the CodeCache will not be flushed without -XX:+UseCodeCacheFlushing
  • -XX:+UseCodeCacheFlushing is not automatically turned on until 1.7.0_4.

But the jconsole shows the CodeCache usage falls down, which surprised me:

CodeCache Usage Falls Down

Is there any explanation for this? What is in CodeCache besides the JIT compiled method?

theMayer
  • 15,456
  • 7
  • 58
  • 90
abuuu
  • 367
  • 3
  • 14
  • Could be due to some methods being uncompiled. – assylias Dec 20 '13 at 08:22
  • Thanks assylias, do you mean some methods need to be discard because of 'over optimized' or something? I read from a JVM article that sometime JVM optimized methods based on statistical information, which may cut out some logical branch that rarely happen. – abuuu Dec 23 '13 at 03:37
  • 1
    There is that or for example methods that need to be decompiled in case of polymorphism - see for example: http://mechanical-sympathy.blogspot.co.uk/2012/04/invoke-interface-optimisations.html. Whether that is the reason for what you observe I don't know - it's only a guess. – assylias Dec 23 '13 at 08:37

1 Answers1

1

The reason maybe is still the option:UseCodeCacheFlushing=true. The default config of 3 version JDK below:

$ java -XX:+PrintFlagsFinal -version | grep CodeCacheFlush
 bool UseCodeCacheFlushing                      = true                                {product}

java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

$ ./java -XX:+PrintFlagsFinal -version | grep CodeCacheFlush
uintx CodeCacheFlushingMinimumFreeSpace         = 1536000         {product}
 intx MinCodeCacheFlushingInterval              = 30              {product}
 bool UseCodeCacheFlushing                      = true            {product}

java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

$ java -XX:+PrintFlagsFinal -version | grep CodeCacheFlush
uintx CodeCacheFlushingMinimumFreeSpace         = 1536000         {product}           
 intx MinCodeCacheFlushingInterval              = 30              {product}           
 bool UseCodeCacheFlushing                      = true            {product}           

java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Richlv
  • 3,954
  • 1
  • 17
  • 21