wood burning stoves 2.0*
The moose likes Java in General and the fly likes JVM heap size limit under Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JVM heap size limit under Windows" Watch "JVM heap size limit under Windows" New topic
Author

JVM heap size limit under Windows

Tom Martin
Greenhorn

Joined: Oct 09, 2009
Posts: 5
Hi,

I'm looking either for some help with a workaround, or
confirmation that the information I've found is still the case for the
current state of Java.

I've run into the Windows jvm heap limit problem.
Development machine is Win XP Pro, 2G RAM.
Biggest heap I can allocate is about 1.6G, and that is not large enough for this
app.

I have a Swing application that
1) must run on Win XP, 32 bit
2) must implement an editor (similar to Excel but with fewer features) to handle large csv files
( up to about 800Mb).
3) Strong preference for Java 5, though higher could conceivably be supported.

Research so far tells me that this is the result of process memory limitations
of Windows and the JVM, and that I *might* be able to squeeze a little more heap with
Windows' rebase command, but probably not enough and I would start running the
risk of conflicts with other applications on my users' systems. Ugh.

Also I read of the Windows /3GB switch, but posts say that the JDK's available are not
built to be able to use that feature. I havent had a chance to add memory to
test that yet. However, I'm also under the impression that I should be able to
allocate a heap larger than physical RAM ... except for that process size limit.

So ... my information is basically that I'm stuck with a limit of about 1.6G for
heap size, regardless of the RAM on my computer.

Can anyone confirm whether that is still correct, preferably with a pointer to some
official reference ?
Or better yet, point me toward a workaround?

Thanks!
-tom
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Never used it before but after a quick reasearch the JVM option "-XX:+AggressiveHeap " seems exactly what you are looking for. Have a look at http://java.sun.com/docs/hotspot/ism.html
Let us know if this solves your problem.
Tom Martin
Greenhorn

Joined: Oct 09, 2009
Posts: 5
Thanks!
I'll post back after some experiementing.

-tom
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Out of curiosity: any results?
Tom Martin
Greenhorn

Joined: Oct 09, 2009
Posts: 5
Joachim Rohde wrote:Out of curiosity: any results?


Sorry, no.

Between /3G switches and changing JVMs,
Boss decided to live with the 2G limit after all, so the priority has dropped.

Off-project time is sparse....
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Tom Martin wrote:
Joachim Rohde wrote:Out of curiosity: any results?


Sorry, no.


32-bit windows even with 3GB switch can allocate maximum 2GB continuous block of memory for a single process.
JVM is a single process - it takes about 200-300MB from this 2GB, each individual thread requires 20-50MB stack space,
the rest is for the heap .... maximum 1600-1700 MB.
64-bit windows (Windows Server 2003 or above) or unix will solve your problem.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM heap size limit under Windows
 
Similar Threads
Out Of Memory Error?
Assigning/allocating memory issues
32 bit JVM memory heap issue on 64 bit XP
Native C code running out of Virtual Address Space ,JNI memory allocation.
Could not reserve enough space for object heap