Arch2Arch Tab
Syndicate this blog (XML)

How to get (almost) 3 GB heap on Windows!

Bookmark Blog Post
Digg Digg
DZone DZone
Furl Furl
Reddit Reddit

Henrik Stahl's Blog | December 6, 2005   4:44 AM | Comments (9)

As you may be aware, the maximum heap size on Window using JRockit - or for that matter any JVM we are aware of - has been limited to slightly below 2 GB. There have been two reasons for this. One is that the maximum process size on Windows has been limited to 2 GB, though this can be worked around by using the /3GB kernel switch. The second is that JVMs have required a contiguous memory space for the Java heap for efficiency reasons, which causes the maximum Java heap size to be limited by DLLs loaded into the process address space.

For more information and previous discussion on this topic see:
Microsoft PAE & /3GB docs
JRockit docs
Sun blog

With the soon to be released JRockit 5.0 R26 this barrier is broken! By introducing support for split heaps, we have been able to significantly increase the Java heap size on Windows.

Windows 2003/XP using the /3GB switch (32-bit OS)
1.85 GB - JRockit 5.0 R25.2 (SP2)
2.85 GB - JRockit 5.0 R26 (SP3)

Windows 2003/XP x64 Edition with a 32-bit JVM (64-bit OS)
2.05 GB - JRockit 5.0 R25.2 (SP2)
3.85 GB - JRockit 5.0 R26 (SP3)

How do I enable this feature?
32-bit Windows
1. Add the /3GB switch to your boot.ini file as described here
2. Install and run JRockit 5.0 R26 specifying a large -Xmx

64-bit Windows
1. Install and run the 32-bit version of JRockit 5.0 R26 specifying a large -Xmx

How large is the performance overhead?

What if I need an even larger heap?
Use one of the many 64-bit version of JRockit.

Are there any drawbacks?
You still need to make sure there is enough memory for JVM internals, compiled code and any native libraries you will be using. If JRockit exits with an out of memory error in native code, try decreasing the heap size slightly.


Comments are listed in date ascending order (oldest first) | Post Comment

  • When will be available some version of JRockit 8.1 or 1.4.2 that suports 3GB and a heap greater then 1750MB on Windows 32 bit?

    Posted by: ftodeschini on December 9, 2005 at 12:11 PM

  • The next JRockit 1.4.2 service pack will have the same feauture. We don't have a public release date yet, but early 2006 is my guess.

    Posted by: hstahl on December 9, 2005 at 12:24 PM

  • Is this feature present in new "BEA JRockit(R) 1.4.2_10 JVM R26.2.0-38"?

    Posted by: ftodeschini on March 23, 2006 at 12:30 PM

  • Yes, this was introduced in JRockit 1.4.2_10 R26.2 now available for download. The entire JRockit Mission Control suite (including the Memleak tool) also works with this version of JRockit 1.4.2.

    Posted by: hstahl on March 23, 2006 at 10:58 PM

  • Why "JRockit 1.4.2_10 R26.2" is not supported for Weblogic Server 8.1? Do you have any documentation about this? Thanks.

    Posted by: ftodeschini on March 24, 2006 at 9:16 AM

  • JRockit 1.4.2 R26 is a new JVM version (R26 as opposed to the old R24). We are not aware of any issues using this version of JRockit with WLS 8.1, but BEA is very serious about quality and we will therefore not claim official support for this combination until it has been fully tested and certified. This will be done as part of the next WLS 8.1 service pack (SP6). In the meantime, feel free to use it for testing and evaluation, but not in production. You can report any issues to our JRockit forums at but not to BEA Support.

    Posted by: hstahl on March 24, 2006 at 9:40 AM

  • Our application requires a lot of memory and must run on 32-bit computers. So we switched to JRockit 1.4.2 R26 on a Windows 2003 Server with 3GB switch. Everything seemed to run fine until we decided to use a concurrent garbage collector (gencon, prio:pausetime). If we specify a Xms of more than 1800M the garbage collector crashes the application after a while (generating a memory dump)

    Has anybody heard about this problem? Is there a fix?

    Posted by: iddley on May 7, 2006 at 2:30 PM

  • There is an issue (CR276313) using a generational nursery with a split heap that may cause a crash. You can use "-Xgc:singlecon" as a workaround for the moment. I'll check what the status is on the fix and will post an update here.

    Posted by: hstahl on May 8, 2006 at 9:25 AM

  • CR276313 has been fixed in JRockit R26.4 which will be released tomorrow (July 6). Also; the 1.4.2 R26.4 version of JRockit will be fully supported with WLS 8.1SP2 and later, so WLS 8.1 customers can finally benefit from this!

    Posted by: hstahl on July 5, 2006 at 11:44 AM

Only logged in users may post comments. Login Here.

Powered by
Movable Type 3.31