Many thanks for the detailed write-up. Do you know how programs that use large in-memory caches avoid full gc cycles to stay fast? Are there tricks to prevent these heavy cycles without disabling the gc?
Comments
Log in with your Bluesky account to leave a comment
Use weak references so that when those cache entries are no longer used anywhere it gets deallocated. This means that when gc runs it will not have that many objects to scan.
If there are long living objects, there is no way around gc at the moment. The best knob is to increase the threshold of old generation because an in memory db means you are happy to pay for memory.
Would have been great if there was a way to say don't scan these objects. But there isn't.
There are some promising changes happening around improving gc which might cut down the costs of a full heap scan quite a lot. I'm keeping an eye on them.
Comments
Would have been great if there was a way to say don't scan these objects. But there isn't.