views:

311

answers:

4

hello, I hope you can help me on the problem we have with SUSE and JDK 1.4.x: my suse is PAE enabled with 15Gb RAM. unfotunately jvm cannot allocate more than 1900Mb for heap size. So java -Xmx2048m gives me an error. it seems you had the same problem, did you solve it? I hope so :)

thanks Michelangelo

+1  A: 

In JDK 1.4 I think you are out of luck. It's a 32-bit JVM, period. You will need to update to a much newer version of Java.

bmargulies
+1  A: 

You should be able to use -mx1960m, but not 2GB indeed. You might want to read http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4435069.

Run multiples JVMs to workaround this "limitation" (but, why do you need that much a heap size for?).

Or update to Java 1.5 to reach the theoretical 4GB limit of a 32-bit JVM which can be much lower in practice (see http://forums.sun.com/thread.jspa?threadID=5207549&start=15). But, again, why do you need that much a heap size for?

Pascal Thivent
Pascal, there are many instances where large heaps are employed. Personally I like to shove it all back at the DB, but keeping large i18n label mappings and cache in heap is quite common. I have numerous >4GiB heaps that incur very little ~0.4% operational GC time.
Xepoch
@Xepoch There are *some* use cases for large heaps but this is unusual. Most of time, people don't need such large heaps and it's worth asking why they want to do so instead of just giving a solution that may not be a very good advice.
Pascal Thivent
+2  A: 

The JVM is limited to a single contiguous block of memory, so although you might be able to tweak a few more MB out of your system by shutting down processes that you don't really need, the only way to see a big increase is to upgrade to a 64 bit Operating System with a 64 bit JRE.

Update: There's a related question on Stack Overflow with some nice answers: What is the Maximum Java Heap Space for SuSE Linux

richj
A: 

just a couple of updates: - on this SUSE machine (where jvm heap max size is 1960m) I can allocate 3.6Gb of heap with several malloc of 10Mb each (C programming). So it sounds quite strange to me. - on another RH4 with same jdk1.4.2 I can allocate: /usr/local/jdks/j2sdk1.4.2_16/bin/java -Xmx2648m with success!! do you know my real RAM on this RH4? just 1024Mb!!! - both SUSE9 and RH4 are PAE enabled (i changed RAM settings easly cause I use VMWare).

So it seems a problem related to SUSE.

michelangelo