by enduku · 5y ago · 0 comments
- Removal of weak references (finalizer, phantom, soft) can help reduce the GC pause time further as these warrant stop the world phase
- Shenandoah likes ReentrantLocks better than synchronised classes the latter bloats up its monitors and increases the size of the rootset
- The reflection problem may initial Shenandoah to run GC cycles even when there is no memory pressure and thus may reduce performance over time. It is better to limit it using reflection inflation flag
- On Amazon ECS, provide the CPU share count explicitly; Shenandoah likes more threads
BTW, you can specify the number of GC threads that you like to use -XX:ConcGCThreads=X -XX:ParallelGCThreads=Y (X for concurrent GC, Y for STW pauses - which should no longer be very relevant).
Cheers!
Other GCs will do the same for you (G1, ZGC) which you can then put into a tool like gceasy to pretty graphs.
I'm in way disputing this, but why would a weak reference be different than any other reference, beyond the added flexibility it gives the GC (you may or may not GC this reference if you please)?
I admit I don't give GC much thought beyond every coupe of years when I switch jobs :)
The easiest way to handle this conflict is to just pause the world when doing the processing of weakrefs after the concurrent GC finishes.
Can you explain this further? I'm missing some connection here between ECS configuration and how the JVM sees the container.
[0]https://docs.aws.amazon.com/AmazonECS/latest/developerguide/...