Sunday, October 24, 2010

Optimizing JVM : tips and tricks

Looking at todays fast paced world performance management and optimization is necessary to stay competent. As working on Java currently, JVM optimization is my current research topic.

JVM works certainly good buy by all means can be improved. I read some suggestions here and will summarize them quickly.

Using JAVA_OPTS -Xmx and -Xms
- If JVM is invoking garbage collection too frequently, meaning that your app heap space is not enough. JVM is using garbage collection to free up some space for your app. Result is drastically reduced performance. -Xmx option can be used to increase the heap space.
- Use -Xms switch to enable heap space equal to maximum allocated memory (all your RAM).
- If garbage collection is using too much time of your CPU, use -Xincgc to garbage collect in phases rather than all in one shot.

No comments:

Post a Comment