Reputation: 2730
I'm going to upload my local Tomcat WebApp to a VPS. I have selected a 2GB RAM VPS, so... how could I know how many GB of RAM should I set in Tomcat for using? I mean, the server has 2GB, but I don't know if it's safe to set 2GB for tomcat or not.
Could anyone give me an advise?
Upvotes: 0
Views: 95
Reputation: 15673
Setting -Xmx2g
is a bad idea. You have to take several memory regions into account when deciding on memory settings:
So your -Xmx
should be a bit less than:
Java Heap = ALL_RAM - UsedByOS - MetaSpace - ExpectedNumberOfThreads * StackSize - other ram used by the jvm
Upvotes: 1