This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Performance and the fly likes JVM Heap size - How Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "JVM Heap size - How" Watch "JVM Heap size - How" New topic
Author

JVM Heap size - How

Ramu Nur
Greenhorn

Joined: Aug 21, 2010
Posts: 20
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

Joined: Feb 24, 2006
Posts: 6588
    
    1

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).


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

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.


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JVM Heap size - How
 
Similar Threads
java.lang.OutOfMemoryError
JVM memory allocation
Java Memory Heap Exception
OutOfMemory Exception. Please Help!
JVM memory allocation