Reputation: 995
I have a ton of pooled objects that will be constantly reused during life of JVM. These objects should never be garbage collected.
I would like a way to optimize the JVM to never attempt (and waste time) checking eligibility for garbage collection. This is especially important since the volume of the pooled objects is going to be quite high, and can cause CPU and GC pressure.
Over a period of time these numerous objects will get into JVM old-gen, and then metaspace, and I would like for a way to hint/optimize the JVM that checking GC eligibility for these numerous objects even during Full-GC (causing longer jvm pauses) is a waste of time, and to never attempt them.
What is the right way to optimize for this situation?
One option is to use off-heap memory. Can I retain these objects in the JVM heap to avoid the off-heap complexity but still optimize GC?
Upvotes: 0
Views: 26