🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java
Article #385

Java in small-memory virtualized Linux environment

#385
From: Kieron Briggs
Date: Thu, 08 Jul 2004 00:48
69 lines
3652 bytes
I am trying to run the java VM in a virtual linux webserver environment 
with WebCentral: 
http://www.webcentral.com.au/docs/products/display.cgi?id=104&productCategory=Linux%20Servers

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:

 > Linux svc014 2.4.20-020stab009.21.777-enterprise #1 SMP Tue Jun 15 
13:21:55 MSD 2004 i686 i686 i386 GNU/Linux

/proc/meminfo says:

 >         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


An strace shows the offending call to be:

 > old_mmap(NULL, 134217728, PROT_READ|PROT_WRITE|PROT_EXEC, 
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/
Technical Details
Message-ID: <40ec99e0$1_1@news.iprimus.com.au>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!cyclone.bc.net!HSNX.atgi.net!cyclone-sf.pbi.net!216.196.106.144!border2.nntp.sjc.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!news.mel.connect.com.au!news.melbourne.pipenetworks.com!figjam.pipenetworks.com!token.pipenetworks.com!218.100.2.59.MISMATCH!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5d71,72c0e4f0f0af508f,start
X-Google-Thread: f9382,72c0e4f0f0af508f,start
X-Google-Thread: 102983,72c0e4f0f0af508f,start
X-Google-Attributes: gidf5d71,gidf9382,gid102983,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 08 Jul 2004 10:48:32 +1000
From: Kieron Briggs <kieron@abuzz.com.au>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.lang.java,comp.os.linux,aus.computers.linux
Subject: Java in small-memory virtualized Linux environment
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 210.50.174.126
Message-ID: <40ec99e0$1_1@news.iprimus.com.au>
Organization: iPrimus Customer - reports relating to abuse should be sent to abuse@iprimus.com.au
X-Original-NNTP-Posting-Host: 127.0.0.1
Lines: 71
NNTP-Posting-Host: 203.134.67.67
X-Trace: 1089239815 un-2park-reader-01.sydney.pipenetworks.com.au 31701 203.134.67.67:4481
X-Complaints-To: Abuse, including message IDs to abuse@pipenetworks.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!cyclone.bc.net!HSNX.atgi.net!cyclone-sf.pbi.net!216.196.106.144!border2.nntp.sjc.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!news.mel.connect.com.au!news.melbourne.pipenetworks.com!figjam.pipenetworks.com!token.pipenetworks.com!218.100.2.59.MISMATCH!not-for-mail