VM Heap Reservation

Discussion in 'Java' started by DaveR, Aug 17, 2006.

  1. DaveR

    DaveR Guest

    On Sun's 1.5 VM running on Windows, it looks like the VM is trying to
    allocate (possibly contiguously) the entire virtual address space
    specified by -mx. This seems to be a change in behavior from previous
    VM's. Does anyone know if this is the case? I'm trying to wrap my
    head around what exactly -mx means now if this is the true. Do we need
    to ensure there's enough swap configured on the machine before booting
    the VM with a particular value for -mx?
     
    DaveR, Aug 17, 2006
    #1
    1. Advertising

  2. In article <>,
    "DaveR" <> wrote:

    > On Sun's 1.5 VM running on Windows, it looks like the VM is trying to
    > allocate (possibly contiguously) the entire virtual address space
    > specified by -mx. This seems to be a change in behavior from previous
    > VM's. Does anyone know if this is the case? I'm trying to wrap my
    > head around what exactly -mx means now if this is the true. Do we need
    > to ensure there's enough swap configured on the machine before booting
    > the VM with a particular value for -mx?


    I've seen no evidence of a change in the behavior of -Xmx since
    switching to 1.5 on XP.

    -Xms is the initial heap size and -Xmx is the maximum. So over the life
    of an app, the heap should never exceed that size. You're sure to
    suffer ill effects if your combination of real RAM and swap space is
    tight (and I've never considered Windows good at managing its virtual
    memory), but it should still work if the -Xmx setting doesn't exceed
    what the VM can support.

    = Steve =
    --
    Steve W. Jackson
    Montgomery, Alabama
     
    Steve W. Jackson, Aug 17, 2006
    #2
    1. Advertising

  3. DaveR

    DaveR Guest

    Understood regarding -Xms. I've create a single test class with a main
    containing only a System.out.println and have tried launching the 1.5
    vm using -Xmx1024m (note there is no -Xms specified) and I get the
    following:

    Error occurred during initialization of VM could not reserve enough
    space for object heap

    Which makes absolutele no sense to me. If I lower the -Xmx to
    something like 750m, the VM launches successfully.

    The NT kernel is purely demand paged, so if you're Java code exhibits
    good page locality, you can get away with a small amount of physical
    adresses space while having adequate swap to cover the needs of your
    heap.

    Dave

    Steve W. Jackson wrote:
    > In article <>,
    > "DaveR" <> wrote:
    >
    > > On Sun's 1.5 VM running on Windows, it looks like the VM is trying to
    > > allocate (possibly contiguously) the entire virtual address space
    > > specified by -mx. This seems to be a change in behavior from previous
    > > VM's. Does anyone know if this is the case? I'm trying to wrap my
    > > head around what exactly -mx means now if this is the true. Do we need
    > > to ensure there's enough swap configured on the machine before booting
    > > the VM with a particular value for -mx?

    >
    > I've seen no evidence of a change in the behavior of -Xmx since
    > switching to 1.5 on XP.
    >
    > -Xms is the initial heap size and -Xmx is the maximum. So over the life
    > of an app, the heap should never exceed that size. You're sure to
    > suffer ill effects if your combination of real RAM and swap space is
    > tight (and I've never considered Windows good at managing its virtual
    > memory), but it should still work if the -Xmx setting doesn't exceed
    > what the VM can support.
    >
    > = Steve =
    > --
    > Steve W. Jackson
    > Montgomery, Alabama
     
    DaveR, Aug 17, 2006
    #3
  4. In article <>,
    "DaveR" <> wrote:

    > Understood regarding -Xms. I've create a single test class with a main
    > containing only a System.out.println and have tried launching the 1.5
    > vm using -Xmx1024m (note there is no -Xms specified) and I get the
    > following:
    >
    > Error occurred during initialization of VM could not reserve enough
    > space for object heap
    >
    > Which makes absolutele no sense to me. If I lower the -Xmx to
    > something like 750m, the VM launches successfully.
    >
    > The NT kernel is purely demand paged, so if you're Java code exhibits
    > good page locality, you can get away with a small amount of physical
    > adresses space while having adequate swap to cover the needs of your
    > heap.
    >
    > Dave


    Not being able to use -Xmx1024m there is a serious problem, I'd say...
    I've been using that with our application for years now, even before we
    later added the -Xms part. I just pulled out a small class I use for
    quick testing that has a main with just a println and tested it using
    only the -Xmx1024m and it worked fine -- Java 1.5.0_06 on XP SP2. We
    stopped supporting NT 4 and earlier, so I haven't got access to any of
    those to see what I'd get.

    = Steve =
    --
    Steve W. Jackson
    Montgomery, Alabama
     
    Steve W. Jackson, Aug 18, 2006
    #4
  5. DaveR

    Guest

    > Not being able to use -Xmx1024m there is a serious problem, I'd say...
    > I've been using that with our application for years now, even before we
    > later added the -Xms part. I just pulled out a small class I use for
    > quick testing that has a main with just a println and tested it using
    > only the -Xmx1024m and it worked fine -- Java 1.5.0_06 on XP SP2. We
    > stopped supporting NT 4 and earlier, so I haven't got access to any of
    > those to see what I'd get.
    >
    > = Steve =
    > --
    > Steve W. Jackson
    > Montgomery, Alabama


    I'm also encountering problems under both Windows XP and Windows 2003
    Server with 2 GB of RAM.

    Up until a few weeks ago, I could use -Xmx1600M without any problem.
    Then during my vacation a colleague called me to tell me that the JVM
    wouldn't start anymore on our development server (the one under Windows
    2003 Server) with this error message :

    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.

    Back then, I tried on my development machine (the one under Windows XP)
    and everything worked properly at -Xmx1600M.

    Now, coming back at work, my Windows has been updated up to the latest
    Patch Thursday (we run Windows Update Server at work so my PC wasn't
    updated until I returned to work). And now, -Xmx1600M doesn't work
    anymore on my dev PC AND on the dev server.

    This leads me to think about a negative interaction between the latest
    patches from Windows Update and the JVM. But I'm really not sure, so if
    anyone has a similar problem, I'd be glad to hear about it.

    Regards,
    Nicolas
     
    , Aug 21, 2006
    #5
  6. DaveR

    DaveR Guest

    As it turns out, this is a problem with Windows security patch 921883.
    We've installed the hotfix for this and it has resolved the problem.

    Dave

    wrote:
    > > Not being able to use -Xmx1024m there is a serious problem, I'd say...
    > > I've been using that with our application for years now, even before we
    > > later added the -Xms part. I just pulled out a small class I use for
    > > quick testing that has a main with just a println and tested it using
    > > only the -Xmx1024m and it worked fine -- Java 1.5.0_06 on XP SP2. We
    > > stopped supporting NT 4 and earlier, so I haven't got access to any of
    > > those to see what I'd get.
    > >
    > > = Steve =
    > > --
    > > Steve W. Jackson
    > > Montgomery, Alabama

    >
    > I'm also encountering problems under both Windows XP and Windows 2003
    > Server with 2 GB of RAM.
    >
    > Up until a few weeks ago, I could use -Xmx1600M without any problem.
    > Then during my vacation a colleague called me to tell me that the JVM
    > wouldn't start anymore on our development server (the one under Windows
    > 2003 Server) with this error message :
    >
    > Error occurred during initialization of VM
    > Could not reserve enough space for object heap
    > Could not create the Java virtual machine.
    >
    > Back then, I tried on my development machine (the one under Windows XP)
    > and everything worked properly at -Xmx1600M.
    >
    > Now, coming back at work, my Windows has been updated up to the latest
    > Patch Thursday (we run Windows Update Server at work so my PC wasn't
    > updated until I returned to work). And now, -Xmx1600M doesn't work
    > anymore on my dev PC AND on the dev server.
    >
    > This leads me to think about a negative interaction between the latest
    > patches from Windows Update and the JVM. But I'm really not sure, so if
    > anyone has a similar problem, I'd be glad to hear about it.
    >
    > Regards,
    > Nicolas
     
    DaveR, Aug 22, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Muz

    travel/reservation code

    Muz, Jun 19, 2004, in forum: Java
    Replies:
    0
    Views:
    576
  2. John Bevilaqua
    Replies:
    0
    Views:
    713
    John Bevilaqua
    Aug 19, 2003
  3. Michal Slocinski

    Heap dump file size vs heap size

    Michal Slocinski, Mar 25, 2008, in forum: Java
    Replies:
    1
    Views:
    738
    GArlington
    Mar 25, 2008
  4. viki
    Replies:
    6
    Views:
    566
    Erik Wikström
    Jun 28, 2008
  5. Raymond Schanks
    Replies:
    0
    Views:
    533
    Raymond Schanks
    Apr 11, 2010
Loading...

Share This Page