Heap and Metaspace problem
Posted: 29 Jan 2026, 06:32
I have sfs version 2.20.3 I have made new features to one of my games. I deployed the jar 5 days laters very strage thing happenned that I have never encaunter before heap stayed down started making horizontal line. When users started complaining that games are freezing I checked and cpu was high and heap was not making sigzag it stuck at 480 mb was not going up I have waited and tried to collect evidence for a while and in the morning ai suggested that I should change vm options and restarted sfs at morning.
-Xms8g
-Xmx8g
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=6g
-XX:+UseG1GC
-XX:MaxGCPauseMillis=500
-XX:ParallelGCThreads=20
-XX:ConcGCThreads=5
-XX:InitiatingHeapOccupancyPercent=70
-XX:NativeMemoryTracking=summary
-XX:+ClassUnloading
-XX:+ClassUnloadingWithConcurrentMark
vm options was like this and I made it
-Xms8g
-Xmx8g
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=2g
-XX:+UseG1GC
-XX:MaxGCPauseMillis=500
-XX:ParallelGCThreads=10
-XX:ConcGCThreads=4
-XX:InitiatingHeapOccupancyPercent=80
I decreased Maxmetaspace basically and this thing happened again this time 2. day users started complaining that game is freezing now I rolled back the vm options now ai suggests metaspace leak .I have another sfs instance another fizical machine it has similar game on it I have made those features on that game and now copied and pasted them to this game. other machine works normal but this machine something is wrong how do I debug it. I have been writing games on sfs for the last 10 years this happened first time. what might cause metaspace leak
Thanks
-Xms8g
-Xmx8g
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=6g
-XX:+UseG1GC
-XX:MaxGCPauseMillis=500
-XX:ParallelGCThreads=20
-XX:ConcGCThreads=5
-XX:InitiatingHeapOccupancyPercent=70
-XX:NativeMemoryTracking=summary
-XX:+ClassUnloading
-XX:+ClassUnloadingWithConcurrentMark
vm options was like this and I made it
-Xms8g
-Xmx8g
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=2g
-XX:+UseG1GC
-XX:MaxGCPauseMillis=500
-XX:ParallelGCThreads=10
-XX:ConcGCThreads=4
-XX:InitiatingHeapOccupancyPercent=80
I decreased Maxmetaspace basically and this thing happened again this time 2. day users started complaining that game is freezing now I rolled back the vm options now ai suggests metaspace leak .I have another sfs instance another fizical machine it has similar game on it I have made those features on that game and now copied and pasted them to this game. other machine works normal but this machine something is wrong how do I debug it. I have been writing games on sfs for the last 10 years this happened first time. what might cause metaspace leak
Thanks