Java in small-memory virtualized Linux environment

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kieron Briggs

    Java in small-memory virtualized Linux environment


    I am trying to run the java VM in a virtual linux webserver environment
    with WebCentral:
    Welcome to Webcentral! Discover fast, secure hosting, web design, and domain services for Australian businesses. Explore our services today!


    When I invoke the java process, it fails with the output:
    [color=blue]
    > Error occurred during initialization of VM
    > Could not reserve enough space for object heap[/color]

    The virtual server has 33MB of committed physical RAM, plus (in theory)
    up to 12GB of virtual RAM and swap. The system is RH9:
    [color=blue]
    > Linux svc014 2.4.20-020stab009.21.7 77-enterprise #1 SMP Tue Jun 15[/color]
    13:21:55 MSD 2004 i686 i686 i386 GNU/Linux

    /proc/meminfo says:
    [color=blue]
    > total: used: free: shared: buffers: cached:
    > Mem: 4232482816 4178165760 54317056 0 920023040 954605568
    > Swap: 8586248192 69046272 8517201920
    > MemTotal: 4133284 kB
    > MemFree: 53044 kB
    > MemShared: 0 kB
    > Buffers: 898460 kB
    > Cached: 922252 kB
    > SwapCached: 9980 kB
    > Active: 929456 kB
    > Inactive: 1100100 kB
    > HighTotal: 556972 kB
    > HighFree: 47136 kB
    > LowTotal: 3576312 kB
    > LowFree: 5908 kB
    > SwapTotal: 8385008 kB
    > SwapFree: 8317580 kB[/color]


    An strace shows the offending call to be:
    [color=blue]
    > old_mmap(NULL, 134217728, PROT_READ|PROT_ WRITE|PROT_EXEC ,[/color]
    MAP_PRIVATE|MAP _ANONYMOUS|MAP_ NORESERVE, -1, 0) = -1 ENOMEM (Cannot
    allocate memory)

    this call is immediately followed by the write() calls to display the
    error message. ulimits for memory are 'unlimited'.


    So, the questions are:

    1. Why is the process unable to allocate 128MB of memory given I should
    have access to virtual memory?

    2. Why is Java requesting 128MB of memory and how can I stop it? This
    number doesn't change even with the -Xms, -Xmx and -Xss options.

    3. Where does this 128MB figure come from and how can I change it?


    I've tried Sun JRE1.4.2 as well as Blackdown JRE1.4.1 and 1.3.1, all
    show the same problem.

    I have also logged a job with WebCentral to see if they have encountered
    the problem before. Any help or ideas are appreciated!


    Thanks in advance,

    Kieron Briggs
    Web Admin, http://www.andrewwilkie.org.au/


  • xarscw@tvrksy.com

    #2
    Re: Java in small-memory virtualized Linux environment

    |When I invoke the java process, it fails with the output:
    |
    | > Error occurred during initialization of VM
    | > Could not reserve enough space for object heap
    |
    |The virtual server has 33MB of committed physical RAM, plus (in theory)
    |up to 12GB of virtual RAM and swap. The system is RH9:

    I've found that current JVMs need a few hundred meg of memory to start.
    33MB may not be enough. I don't know how the virtualised memory works on
    webcentral. What's the significance of the 33 MB?
    --

    Comment

    • Kieron Briggs

      #3
      Re: Java in small-memory virtualized Linux environment

      xarscw@tvrksy.c om wrote:[color=blue]
      > |When I invoke the java process, it fails with the output:
      > |
      > | > Error occurred during initialization of VM
      > | > Could not reserve enough space for object heap
      > |
      > |The virtual server has 33MB of committed physical RAM, plus (in theory)
      > |up to 12GB of virtual RAM and swap. The system is RH9:
      >
      > I've found that current JVMs need a few hundred meg of memory to start.
      > 33MB may not be enough. I don't know how the virtualised memory works on
      > webcentral. What's the significance of the 33 MB?[/color]

      As I understand it (and I could be completely wrong I guess), my virtual
      server is guarenteed to have 33MB of its memory mapped into actual
      physical RAM at any one time, and may have up to 2GB mapped depending on
      system resource availability ('burstable'). From the /proc/meminfo
      output I believe that my virtual server has 4 GB of 'RAM', most of which
      will actually be on the physical machine's swap...

      Comment

      • Gregory Toomey

        #4
        Re: Java in small-memory virtualized Linux environment

        Kieron Briggs wrote:
        [color=blue]
        >
        > I am trying to run the java VM in a virtual linux webserver environment
        > with WebCentral:
        > http://www.webcentral.com.au/docs/products[/color]
        display.cgi?id= 104&productCate gory=Linux%20Se rvers

        The price is outrageous.

        I use www.linode.com & is by far the best offering, & it runs UML.


        [color=blue]
        > When I invoke the java process, it fails with the output:
        >[color=green]
        > > Error occurred during initialization of VM
        > > Could not reserve enough space for object heap[/color]
        >
        > The virtual server has 33MB of committed physical RAM, plus (in theory)
        > up to 12GB of virtual RAM and swap. The system is RH9:
        >[/color]

        I have no trouble running Java & Tomcat thru Linode.

        gtoomey

        Comment

        Working...