| 
		
			| *SOLVED* Java: Could not reserve enough space for object heap [message #7057] | Mon, 02 October 2006 16:01  |  
			| 
				
				
					|  hm2k Messages: 32
 Registered: August 2006
 Location: UK
 | Member |  |  |  
	| I am running CentOS on the hardware node with OpenVZ, running a Fedora VPS. 
 I am trying to run software that uses Java, and I keep getting the following error:
 
 
 | Quote: |  | -bash-3.00# /usr/java/jre1.5.0_06/bin/java -version
 Error occurred during initialization of VM
 Could not reserve enough space for object heap
 Could not create the Java virtual machine.
 
 | 
 
 How can I fix this?
 
 Thanks.
 [Updated on: Wed, 04 October 2006 06:04] by Moderator Report message to a moderator |  
	|  |  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	|  | 
	| 
		
			| Re: Java: Could not reserve enough space for object heap [message #7092 is a reply to message #7088] | Tue, 03 October 2006 15:14   |  
			| 
				
				
					|  ckpeter Messages: 8
 Registered: October 2006
 | Junior Member |  |  |  
	| | hm2k wrote on Tue, 03 October 2006 08:06 |  | 
 -bash-3.00# /usr/java/jre1.5.0_06/bin/java -version -Xmx256m
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
 Still not working...
 
 
 resource           held    maxheld    barrier      limit    failcnt
privvmpages       23499      38193      69152      73575          6
 The held and failcnt has increased since I have run it a couple of times since, however nothing else has changed, no limits or barriers appear to have been reached, even though the failcnt has increased.
 
 What could be the problem?
 
 | 
 
 It looks like your total limit is about 256 MB for the VPS. Did you try lower value of -Xmx? Try -Xmx32m. Remember too that the value specified is only for the Java heap (the actual JVM memory usage will be higher), so you can't just specify a value that is at the limit of your VPS's memory allocation.
 [Updated on: Tue, 03 October 2006 15:19] Report message to a moderator |  
	|  |  | 
	|  | 
	|  | 
	| 
		
			| Re: Java: Could not reserve enough space for object heap [message #16179 is a reply to message #16165] | Mon, 27 August 2007 00:20   |  
			| 
				
				
					|  locutius Messages: 125
 Registered: August 2007
 | Senior Member |  |  |  
	| 
-bash-3.00# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       104: kmemsize        3943800    4160542    9753527    9752512          0
            lockedpages           0          0         32         32          0
            privvmpages       23222      38193      69152      73575          2
            shmpages           2441       3417       8192       8192          0
            dummy                 0          0          0          0          0
            numproc              53         58        256        256          0
            physpages         14000      16202          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages      14004      16202       6144 2147483647          0
            numtcpsock            8         12         80         80          0
            numflock              4         10        100        110          0
            numpty                1          1         16         16          0
            numsiginfo            0          3        256        256          0
            tcpsndbuf             0      24508     319488     524288          0
            tcprcvbuf             0      10116     319488     524288          0
            othersockbuf      22280      27124     132096     336896          0
            dgramrcvbuf           0       2228     132096     132096          0
            numothersock         15         21         80         80          0
            dcachesize       237062     270354    1048576    1097728          0
            numfile            3239       3501       4086       4086          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        128        128          0
 privvmpages is the amount of memory than can be allocated by processes, it does not account memory use
 
 vmguarpages is the memory guaranteed for use, and it is woefully low at 6144 (looks like the default config for pong)
 
 oomguarpages is accounting the actual memory use and you can see it far exceeds vmguarpages
 
 guys plz read up in the wiki on /proc/user_beancounters
 
 AND WARNING! dont take the default config and try to adjust it up for a Java machine because there is zero match to your hardware. use vzsplit 8 or 16 or more ways to discover your hardware capabilities
 [Updated on: Mon, 27 August 2007 00:21] Report message to a moderator |  
	|  |  | 
	| 
		
			| Re: Java: Could not reserve enough space for object heap [message #28116 is a reply to message #16179] | Sun, 09 March 2008 19:49  |  
			| 
				
				
					|  ttest Messages: 1
 Registered: March 2008
 | Junior Member |  |  |  
	| There's a more elegant way to modify the default VM type that's used on Linux. This can be set in /etc/java-1.5.0-sun/jvm.cfg 
 Mine now looks like:
 #-client IF_SERVER_CLASS -server
 -client KNOWN
 -server KNOWN
 -hotspot ALIASED_TO -client
 -classic WARN
 -native ERROR
 -green ERROR
 
 Greets
 
 Christian
 |  
	|  |  |