Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 248057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:18:40+00:00 2026-05-11T21:18:40+00:00

What is the maximum heap size that you can allocate on 32-bit Windows for

  • 0

What is the maximum heap size that you can allocate on 32-bit Windows for a Java process using -Xmx?

I’m asking because I want to use the ETOPO1 data in OpenMap and the raw binary float file is about 910 MB.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:18:40+00:00Added an answer on May 11, 2026 at 9:18 pm

    There’s nothing better than an empirical experiment to answer your question.
    I’ve wrote a Java program and run it while specifying the XMX flag (also used XMS=XMX to force the JVM pre-allocate all of the memory).
    To further protect against JVM optimizations, I’ve actively allocate X number of 10MB objects.
    I run a number of test on a number of JVMs increasing the XMX value together with increasing the number of MB allocated, on a different 32bit operating systems using both Sun and IBM JVMs, here’s a summary of the results:

    OS:Windows XP SP2, JVM: Sun 1.6.0_02, Max heap size: 1470 MB
    OS: Windows XP SP2, JVM: IBM 1.5, Max heap size: 1810 MB
    OS: Windows Server 2003 SE, JVM: IBM 1.5, Max heap size: 1850 MB
    OS: Linux 2.6, JVM: IBM 1.5, Max heap size: 2750 MB

    Here’s the detailed run attempts together with the allocation class helper source code:

    WinXP SP2, SUN JVM:

    C:>java -version
    java version "1.6.0_02"
    Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode)

    java -Xms1470m -Xmx1470m Class1 142
    ...
    about to create object 141
    object 141 created

    C:>java -Xms1480m -Xmx1480m Class1 145
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.

    WinXP SP2, IBM JVM

     
    C:>c:\ibm\jdk\bin\java.exe -version
    java version "1.5.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build pwi32devifx-20070323 (if
    ix 117674: SR4 + 116644 + 114941 + 116110 + 114881))
    IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223ifx-2007
    0323 (JIT enabled)
    J9VM - 20070322_12058_lHdSMR
    JIT  - 20070109_1805ifx3_r8
    GC   - WASIFIX_2007)
    JCL  - 20070131

    c:\ibm\jdk\bin\java.exe -Xms1810m -Xmx1810m Class1 178
    ...
    about to create object 177
    object 177 created

    C:>c:\ibm\jdk\bin\java.exe -Xms1820m -Xmx1820m Class1 179
    JVMJ9VM015W Initialization error for library j9gc23(2): Failed to instantiate he
    ap. 1820M requested
    Could not create the Java virtual machine.
    Win2003 SE, IBM JVM

    C:>"C:\IBM\java" -Xms1850m -Xmx1850m Class1
    sleeping for 5 seconds.
    Done.

    C:>"C:\IBM\java" -Xms1880m -Xmx1880m
    Class1
    JVMJ9VM015W Initialization error for library j9gc23(2): Failed to instantiate he
    ap. 1880M requested
    Could not create the Java virtual machine.
    Linux 2.6, IBM JVM

    [root@myMachine ~]# /opt/ibm/java2-i386-50/bin/java -version
    java version "1.5.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20060511 (SR2))
    IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20060504 (JIT enabled)
    J9VM - 20060501_06428_lHdSMR
    JIT  - 20060428_1800_r8
    GC   - 20060501_AA)
    JCL  - 20060511a

    /opt/ibm/java2-i386-50/bin/java -Xms2750m -Xmx2750m Class1 270

    [root@myMachine ~]# /opt/ibm/java2-i386-50/bin/java -Xms2800m -Xmx2800m Class1 270
    JVMJ9VM015W Initialization error for library j9gc23(2): Failed to instantiate heap. 2800M requested
    Could not create the Java virtual machine.

    Here’s the code:

    
    import java.util.StringTokenizer;
    
    
    public class Class1 {
    
            public Class1() {}
    
            private class BigObject {
                    byte _myArr[];
                    public BigObject() {
                            _myArr = new byte[10000000];
                    }
            }
        public static void main(String[] args) {
                    (new Class1()).perform(Integer.parseInt(args[0]));
            }
            public void perform(int numOfObjects) {
                    System.out.println("creating 10 MB arrays.");
                    BigObject arr[]  = new BigObject[numOfObjects];
                    for (int i=0;i <numOfObjects; i++) {
                            System.out.println("about to create object "+i);
                            arr[i] = new BigObject();
                            System.out.println("object "+i+" created");
                    }
                    System.out.println("sleeping for 5 seconds.");
                    try {
                    Thread.sleep(5000);
                    }catch (Exception e) {e.printStackTrace();}
                    System.out.println("Done.");
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The theoretical maximum heap value that can be set with -Xmx in a 32-bit
There are -Xmx and max-heap-size (jnlp) options to set maximum memory java application can
How can I calculate the maximum maximum heap size avalable for java application in
I can set the Java Heap Size minimum and maximum by passing the parameters
I'd want to restrict the maximum heap size for a Java application but it
Possible Duplicate: Maximum Java heap size of a 32-bit JVM on a 64-bit OS
The question is not about the maximum heap size on a 32-bit OS, given
What is the maximum heap size allowed for a running process in a linux
From one of Google's presentations, I came to know that the maximum Heap Size
I want to increase the heap size of my Glassfish. For that, I know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.