Question

Can I expect negative effects on my Tomcat performance if I set initial heap size relatively low (say, -Xms128m) and maximum heap size really high (-Xmx4g)? Also, does seting -XX:MaxPermSize to the same value as -Xms have any effect?

Was it helpful?

Solution

It is advisable to have Xms close to your applications normal usage. Setting Xms to a low value when application requires more memory will result in frequent gc. This will slow down the application till enough memory is allocated to JVM. The memory allocated in this case might be fragmented and that will impact performance. I generally have both Xms and Xmx set to the same value.

I do not think there is any relationship between MaxPermSize and Xms. Both are independent of each other. PermSize is additional to Xmx setting and is used for holding class objects and method objects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top