• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JVM Max Heap Size recommended

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We have a J2EE application being deployed in the production environment on SAP's NetWeaver application server. The server machine on which the application is being deployed has 16GB RAM, with no other major application running on the same server. Even the NetWeaver application server is going to host our application alone.

We are trying to figure out what would be an ideal value for JVM max heap size for the application server. If we can have JVM max heap size in the range of 4 to 8 GB, we can enable multi threading in our application to process transactional data in parallel. But I came across a reference in one of the articles which said for max heap size beyond 2GB, the applications starts experiencing garbage collection pauses, as the garbage collector runs take much longer to complete.

Can anybody provide us with any inputs on this? Particularly, what's the maximum JVM heap size one can have, without having to suffer from any such issues as garbage collection pauses?

Thanks
Neelesh
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have experience of using such large heaps, but it would seem a shame to constrain your application to use much less than the machine has available.

There are lots of different garbage collector configuration parameters available. There are a number of different garbage collectors available, and each one has settings to twiddle They let you trade off things total amount of GC time versus maximum pause time etc. I'd imagine that somewhere in the space of settings is one that would suit your application.

I suggest careful consultation of the documentation of your JVM's GC settings, and some experimentation.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Neelesh,

If you are using a 32 bit JVM, what you have read (max heap size ~ 2GB) is correct. It won't allow you to configure any higher value for heap. However, that is not the only parameter which can be tuned.

If you switch on the VERBOSEGC, and find that the number of minor garbage collections are higher than the major ones, adjusting the new to old generation ratio (to provide more space to the new generation objects) would bring down the frequency of garbage collections in the JVM.

I hope you are using Hotspot JVM, aren't you?

HTH
Steve
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Configuring and tuning the Sun garbage collector can actually get complicated -- and quite frankly doesn't always work. (meaning there are tradeoffs)

Henry
 
Neelesh A Korade
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all the inputs everyone. That really helps. Just to clarify a few queries made in the responses-

We are using a 64bit JVM. And the JVM is a Hotspot one.

I will look at the Hotspot GC documentation. Thanks for all the help.

-Neelesh
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/docs/hotspot/gc1.4.2/#4.2.2.%20AggressiveHeap|outline looks interesting
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic