1

We're using JDK 8 and some of our processes are giving OOM with "compressed class space". We're logging GC and our jvm statistics.log file currently gives the following type of log entries

2017-06-30 03:57:07,944 INFO - HEAP - [USAGE: 1678.7, FREE: 986.7, TOTAL: 2665.5, MAX: 2665.5]; PERM - [USAGE: N/A, FREE: N/A, MAX: N/A]; CLASSES - [Loaded: 1832624, Unloaded: 637, Left: 1831987]; THREADS - [Count: 92]

We're wondering if adding the flags "-XX:+TraceClassUnloading -XX:+TraceClassLoading" would let us know what value we should set for the "Compressed Class space" ( -XX: CompressedClassSpaceSize) ? If yes, how do we determine the size from the Trace logs ?

anjanb
  • 12,999
  • 18
  • 77
  • 106
  • 3
    When you don’t know what the best value for that option is, don’t specify that option and let the JVM choose. If you think that 1832624 classes are quiet large, you may check for leaks in your application. – Holger Jul 14 '17 at 14:59

1 Answers1

2

You can use -XX:-UseCompressedClassPointers to disable the compressed class space which should allow the JVM to load as many classes as fit into memory instead of the limited compressed class virtual memory region. The drawback are larger class pointers in object headers.

But as @Holger mentioned in the comments you should make sure that your application isn't leaking classes over time, otherwise memory consumption will keep growing.

the8472
  • 40,999
  • 5
  • 70
  • 122
  • Our application uses JAXB. I suspect that we might be having this issue : https://stackoverflow.com/questions/3259291/do-i-have-a-jaxb-classloader-leak – anjanb Jul 16 '17 at 10:27