Meaningless Drivel is fun!
The moose likes Performance and the fly likes Any concerns for large heap size? (e.g. 2GB) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Any concerns for large heap size? (e.g. 2GB)" Watch "Any concerns for large heap size? (e.g. 2GB)" New topic

Any concerns for large heap size? (e.g. 2GB)

Henry Leung

Joined: Oct 26, 2003
Posts: 24
Our server has 4GB RAM, and it runs nothing else except the JBoss Appserver and Apache HTTP server. So I think we can definitely afford a heap size as large as 1-2GB. However, I heard that there are some concerns when the heap size is larger than 1GB. Some say these problems are platform/OS-dependent. I wonder if there is any information about this issue?

My environment:
Windows 2003 Entreprise Edition, JBoss 2.4.8, J2SE1.3.1
[ September 09, 2005: Message edited by: Henry Leung ]
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

We noticed that our sever doesn't start if we set xmx to 2gb. However it works fine with 1.5gb. Sun's site has an articale about right settings for xms and xmx. I think with latest VM you can afford up to 4gb.
We have 4 CPUs 4 GB box and w2k.

Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Gokul Somasundaram

Joined: Jul 17, 2005
Posts: 20
JVM 1.3.1 is a 32 Bit JVM. So you can address upto 2^32 bytes (4 GB). There are Memory requirements for JVM other than Heap like the Memory requirement for the Threads etc.
To my knowledge, you can have a heap of 4GB - Thread stack size * (no. of threads). 3.5 GB Safely.

With JVM 1.4.2 you have the -d64 option with which you get a 64 bit JVM and you can address more space 2^64 Bytes(Very huge).

But as you take larger heaps the no. of GCs reduce(advantage), and the time taken per GC increase(disadvantage). With JVM 1.3.1, the GC is single threaded and it will stop the application threads. So Check the response time affordability of your application
subject: Any concerns for large heap size? (e.g. 2GB)
jQuery in Action, 3rd edition