How to cause a very high heap fragmentation in Java 8 HotSpot using CMS GC

181 Views Asked by At

I am studying Java8 HotSpot heap fragmentation (on CMS), and I'm struggling to write some code that produces high fragmentation. I've been trying with very large objects without success.

Could someone post a code that creates a very high heap fragmentation (that reaches a promotion failure), so I could study it ?

Thanks

1

There are 1 best solutions below

0
Alexey Ragozin On BEST ANSWER

Take a look at HeapFragger by Gil Tene from Azul systems.

It is tool build to demonstrate flaws in HotSpot JVM garbage collection.