[11] RFR(S): 8205499: C1 temporary code buffers are not removed with -XX:+UseDynamicNumberOfCompilerThreads

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jun 28 10:39:19 UTC 2018


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8205499
http://cr.openjdk.java.net/~thartmann/8205499/webrev.00/

The problem is that with -XX:+UseDynamicNumberOfCompilerThreads, compiler threads are dynamically
created and removed but the C1 temporary code buffers are not deallocated. As a result, the code
cache fills up with long running applications, disabling compilation.

I was able to reproduce this by slightly modifying the code such that compiler threads are
aggressively added and removed. The code cache quickly fills up and we get the expected warning [1].
I was not able to create a stable regression test because that would require to alternate between
generating compilation tasks and waiting for compiler threads to become idle and get removed (i.e.,
the test would be long running).

The fix is to deallocate the code buffers in the thread destructor. I've verified that this solves
the issue.

Thanks,
Tobias

[1] Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using
-XX:ReservedCodeCacheSize=
CodeCache: size=51200Kb used=50978Kb max_used=50990Kb free=221Kb
 bounds [0x00007fd068e00000, 0x00007fd06c000000, 0x00007fd06c000000]
 total_blobs=1284 nmethods=237 adapters=787
 compilation: disabled (not enough contiguous free space left)
              stopped_count=1, restarted_count=0
 full_count=0
Java HotSpot(TM) 64-Bit Server VM warning: Initialization of C1 CompilerThread3 thread failed (no
space to run compilers)
Java HotSpot(TM) 64-Bit Server VM warning: Initialization of C1 CompilerThread5 thread failed (no
space to run compilers)
Java HotSpot(TM) 64-Bit Server VM warning: Initialization of C1 CompilerThread4 thread failed (no
space to run compilers)


More information about the hotspot-compiler-dev mailing list