Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM Heap size - How

 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is there a standard technique to set the JVM heap size for an application? Or is it a trail-and-error (after profiling) with some start up values?

Thanks
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trail and error mostly. Some apps hog memory and others dont. It depends on how state is maintained; what is cached; how large the cache is; what the purge policy for caches are; etc etc.

A load and performance test usually highlights the limits of CPU / memory / Threads. A good rule of thumb is to add some buffer to the max limit (say 20%. But 20% of what number ? That can be a factor too).
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, i agree to Deepak. Its mainly by trial error.
One thing to look is how often does JVM do GC. Make sure its not spending most of its time doing GC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic