hpi-swa / trufflesqueak

A Squeak/Smalltalk VM and Polyglot Programming Environment for the GraalVM.
MIT License
286 stars 14 forks source link

Running Trufflesqueak for a long time causes the CodeCache to be filled #138

Closed janehmueller closed 11 months ago

janehmueller commented 3 years ago

If I run my TruffleSqueak image for a longer time (which increases performance due to the jit) I get the following warning:

OpenJDK 64-Bit Server VM GraalVM 21.0.0.2 warning: CodeCache is full. Compiler has been disabled.
OpenJDK 64-Bit Server VM GraalVM 21.0.0.2 warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=327680Kb used=321830Kb max_used=322483Kb free=5849Kb
 bounds [0x0000000006680000, 0x000000001a680000, 0x000000001a680000]
 total_blobs=19933 nmethods=19132 adapters=706
 compilation: enabled
fniephaus commented 3 years ago

Thanks, this needs to be monitored and reported to the GraalVM team. As the warning suggests, the cache size can be increased, for example via:

trufflesqueak --vm.XX:ReservedCodeCacheSize=256M ...

We might also want to experiment with the latency mode, which I think turns off inlining and splitting, which in turn should reduce compiled code sizes significantly:

trufflesqueak --engine.Mode=latency ...

You can also disable Truffle compilation entirely via:

trufflesqueak --engine.Compilation=false --experimental-options ...

The code cache shouldn't get filled up entirely when this is enabled, otherwise we'd really need to look into this. It's certainly something we should try. In any case, I'd appreciate your feedback on any of these three command line flags and how they improve (or even worsen) the problem.

fniephaus commented 11 months ago

I cannot reproduce this anymore, so maybe this got fixed along the way :crossed_fingers: