3 ms·
If you could add some sort of hint to the object pool instance that it should always be in the new generation, then you wouldn’t have this problem. This could p
by fiddlerwoaroof 2y ago
If you could add some sort of hint to the object pool instance that it should always be in the new generation, then you wouldn’t have this problem. This could probably be provided generically as a class named something like NurseryCollection.
However, I thought the people that really were serious about performance would allocate the pool in memory the GC doesn’t control (back in the day using internal APIs, but I think there are new official APIs for this) such that the object pool and every object in it would just be ignored by the GC.
- hinkley 2y agoLooks like an arena allocator is available in JDK 20. But I’m fairly sure it’s been in the RT spec for a lot longer.