Page 1 of 1

Same machine spec but got different initial max mem heap usage

Posted: 21 Mar 2024, 09:22
by hng
Dear Lapo,

I have another issue, we have 2 machine with same spec OS Win 64Bit 2.5GHz 4Core 16GB, same application, same version sfs, both no user activity only startup and both start the app using batch file :

@..\jre\bin\java.exe -cp "./;lib/*;lib/apache-tomcat/bin/*;extensions/__lib__/*;extensions/test-zone-extension/*"
-XX:+UseParallelGC
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=5000
-Dcom.sun.management.jmxremote.rmi.port=5000
-Djava.rmi.server.hostname=127.0.0.1
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main %1 %2

but the first machine only using around 250Mb max heap memory on the other hand the second machine using 1.5Gb max heap memory.

How does the SFS works for initialing the first max mem heap when server start ? and is there a setting that i might miss to setup the initial max memory heap ?

first machine only used 250Mb MAX Memory Heap
Image


Second machine use 1.5Gb MAX Memory Heap
Image














Best Regards
HNG

Re: Same machine spec but got different initial max mem heap usage

Posted: 21 Mar 2024, 10:02
by Lapo
Hello,
without custom memory settings the Java Virtual Machine (JVM) will allocate the heap size dynamically. You can read more on how this works here, for example: https://stackoverflow.com/questions/466 ... determined

I wouldn't worry too much about this as the JVM is very efficient at using memory when needed, but if you have particular requirements you can go ahead and configure it as you please by the necessary extra settings.

By the look of the two graph you have posted it seems that the 2 servers are doing very different things, which in turn can cause different patterns of memory usage.

Cheers

Re: Same machine spec but got different initial max mem heap usage

Posted: 21 Mar 2024, 10:03
by Lapo
Also, if you want to learn more about memory management and settings we have a two part article in our blog, here:
https://smartfoxserver.com/blog/sfs2x-m ... on-part-1/
https://smartfoxserver.com/blog/sfs2x-m ... on-part-2/

Cheers

Re: Same machine spec but got different initial max mem heap usage

Posted: 21 Mar 2024, 11:40
by hng
Thank you for the fast response Lapo. Both are using the same extension JAR, I will study the link you share thanks again.





Best regards
Hng