samarth
samarth

Reputation: 4024

How the java heap allocation for eden and other generation affects the Garbage collection and Performance?

I want to know how different values set for the Xmx, Xms, Xmn and Xss Affects the Garbage collection and Performance?

On basis of what parameters we can decide the optimum values for these parameters?

What are the tools available for the monitoring and analyzing the same?

Upvotes: 1

Views: 417

Answers (3)

alain.janinm
alain.janinm

Reputation: 20065

So first some helpful link :

  1. GC tuning
  2. Diagnosing a Garbage Collection problem
  3. Monitoring
  4. GC FAQ

For monitoring I'm used to Netbeans Profiler.

You can also set some VM option to print GC activity with (for example) :

-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime

or

-agentlib:hprof=heap=all

Finally you can monitor your app using MemoryMXBean.

There is a lot of other monitoring tools, choose yours!

Upvotes: 0

Peter Lawrey
Peter Lawrey

Reputation: 533530

Usually the best thing is to performance test you application under realistic load.

Generally speaking these parameters are reasonably optimal if you leave them alone. You should only set them if you know doing so improves performance. To know it improves performance you should have a load test which demonstrates that performance is better with that setting. (Anything else is just guess work)

Upvotes: 1

jay
jay

Reputation: 811

If you want a detailed description http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#generation_sizing is one of the better resources to follow .

As far as the tools are concerned , apart from the default java tools like Hprof ,hat ,visualvm and Jconsole . Other commercial ones also exist like Appdynamics , yourkit , jprofiler , dynatrace ,newrelic ,etc .

Upvotes: 3

Related Questions