Heap and Metaspace problem

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
User avatar
ekrem5353
Posts: 122
Joined: 10 Dec 2015, 15:50

Heap and Metaspace problem

Post by ekrem5353 »

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
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Heap and Metaspace problem

Post by Lapo »

Hi,
Metaspace is affected when Running lots of Rooms each with its Extension, especially when the Extension is pretty big maybe because of dependencies. Since every Room Extension is by default loaded in a new classloaders you end up with many copies of your Extension class and dependencies, one for each active Room.

Is this the case for your game?
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
How high was the CPU usage?
Have you checked the logs for recurring errors? This may help narrow down the issue.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply