Does a java-application need more memory while starting? (overheap-memory?)
I have the following problem:
At my home desktop I have the following memory use:
- 160 MB Linux (Debian) after start
- 50 MB additionally after starting a first java-applikation
- 60 MB additionally after starting a second java-applikation
So together 270MB memory (swap memory = 0). Everything works fine.
Now I want to inplement the same at a v-server with 256 MB memory.
- 60 MB Linux/Debian
- 50 MB first java
- 60 MB second java
= 170 MB
So theoretically this should work with 256 MB memory.
But I get an heap-error when starting the second java-applikation. Why this? (The Xmx and Xms values are set in the correct way.)
One possibility is, that their is not 256MB as my hoster promised me (may be just 100MB guaranteed or so). But my hoster says their is 256MB. He argues, that the java-applications use "overheap-memory" while starting. I never heard about this. Is he right.? Do java-applikations need more memory during the starting process than afterwards? So in my example: Do the both applications need more than 110MB while starting?
[1134 byte] By [
lacarpe2a] at [2007-11-27 0:01:20]

# 3
> One possibility is, that their is not 256MB as my
> hoster promised me (may be just 100MB guaranteed or
> so). But my hoster says their is 256MB. He argues,
> that the java-applications use "overheap-memory"
> while starting.
That person is an idiot.
Even if it used more memory on start up it wouldn't use 80 meg more.
You can test this on your home system - simply increase the first java apps min (and max) memory so that your home system more closely simulates the start up memory available for the second java app.
At some point you would reach a threshold, which I suspect would be no more than 5 meg over what would be expected.
# 4
> JRE 1.5.0.06
> Options -server -Xms45 -Xmx45
>
> At my desktop at home this runs well.
> At the v-server I get the message:
> " Error occurred during initialization of VM
> Could not reserve enough space for object heap
> Could not create the Java virtual machine."
Technically, if you look at the memory map of the JVM process (for example with pmap command on UNIX systems) you will see a number of segments besides the Java object heap. These will include code segments for the VM and native libraries, thread stacks and a C-heap. So yes, formally speaking, java does require slightly more memory then that you've specified with an -Xmx key.
What happens in your case (if you reported your command line options correctly) is that -Xmx and -Xms require sizes in bytes. So unless you have specified -Xms45M -Xmx45M in reality, you want a very small heap.
Igor Veresov, HotSpot GC
ihva at 2007-7-11 15:52:30 >
