Incorrect Memory Usage Reported When Using ZGC + sun.misc.Unsafe

Alex Elent alex at scalyr.com
Fri Jan 4 01:22:14 UTC 2019


Hello,

Looking for some help on an issue we are experiencing exclusively with ZGC.
I'm unsure if the problem lies with ZGC or the kernel or where. Looking for
your experienced guidance if possible.

We experienced this in our actual application but I managed to create a
simpler reproducible case.

I've attached the example Java file (TestUnsafe.java).
I've attached a screenshot of top reporting 108% resident memory used.

This is running on an EC2 t2.medium instance (2 vCPU / 4GB RAM).

I compile with:
javac -cp . TestUnsafe.java

I run with:
java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms3500M -Xmx3500M -cp .
TestUnsafe

Thank you so much for your help!


More information about the zgc-dev mailing list