Hello Johan,
I’m back with some other comments on the server memory issue. I also discussed with Nicola Gervasi and he gave me some more tips. They were really helpful, so right now it seems that the server is more stable concerning the memory, I hope it will keep this way. He told me about 2 java parameters that can force java to get rid of unused memory so now I always have at most 1.3GB consumed, instead of more then 2GB:
root 6207 5.6 29.1 2329884 1228580 ? Sl 03:55 1:52 java -Djava.awt.headless=true -Xmx1048m -Xms256m -XX:MaxPermSize=128m -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=10 -classpath .:lib/
I just used these params, as you can see :
-XX:MaxHeapFreeRatio=10
-XX:MinHeapFreeRatio=10
I didn’t reinstall java, because this is the only online server running so far, so we wanted to make first some tests on other computes and then decide.
On another linux server the memory at startup without those params is this:
root 3775 0.2 45.7 1382552 939508 ? Sl Oct20 2:48 java -Djava.awt.headless=true -Xmx256m -Xms64m -XX:MaxPermSize=128m -classpath .:lib/ohj-jewt.jar:lib/MRJAdapter.jar:lib/compat141.jar:lib/commons-
Heap memory: allocated=67672K, used=42568K, max=253440K
None Heap memory: allocated=67392K, used=66661K, max=180224K
Still too high, I think, without any clients connected. Java using 1GB while the heap used is 42MB.
On a mac it looks better, though:
bogdan 10640 0.0 8.8 4197316 367556 s000 S 2:37PM 1:25.29 /usr/bin/java -Djava.awt.headless=true -Xmx1024m -Xms256m -XX:MaxPermSize=128m -XX:MaxHeapFreeRatio=10 -
This is the memory after connecting some client. Btw, all clients we have are web clients. On this mac, java starts with a little more then 200MB. When connecting with first webclient the memory reach almost 1GB, or 700MB sometimes, then after few minutes it decrease. Then when connecting another client it won’t jump to 1GB again, but stabilize somewhere between 350MB and 500MB.
We also thought that the errors we have in the log might cause this, although it doesn’t seems to relevant. If they would leak memory, the leaks would be in the heap. But I’ll also try to fix as many using your tips and then I’ll wrote back on the other topic.
Kind Regards,
Bogdan.