Re: free reporting wrong values?



At Wed, 11 Jun 2008 08:03:03 +0200 =?ISO-8859-1?Q?Christian_Schr=F6der?= <chschroe@xxxxxxxxxxxxxxxxxxxxxx> wrote:


Robert M. Riches Jr. wrote:
The JVM imposes limits of its own. Try

java -X

to see some of them. The initial and maximum heap sizes are
probably what you're looking for.

The problem with java was that I gave the JVM 2048M initial heap size
(-Xmx2048m) which should have been possible according to "free", but the
JVM did not even start and instead gave me error messages:

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

So I asked myself (and also the newsgroup) why java was unable to
reserve the requested memory although "free" reported that enough was
available.

To answer this question I wrote that little C program and found out that
it also could not reserve as much memory as "free" reported. Thus, the
question is NOT java specific, but more general: Why does "free" report
2.5G of free memory, but only 1.5G are available to an application?
(That's exactly what I asked in my original post. Maybe the java stuff
was misleading. I just tried to give some context.)

Regards,
Christian

Are you running a 686 (32-bit x86) kernel on a x86_64 machine? Or
32-bit applications on a 64-bit machine?



--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@xxxxxxxxxxxx -- Contract Programming: C/C++, Tcl/Tk

.



Relevant Pages

  • Re: Heap and Memory Footprint
    ... If you have any mixed language objects (i.e. Java objects which have underlying native memory associated), when the object is created memory is allocated in both the Java heap and the C native heap. ... It is important to explicitly call close- otherwise if the object gets promoted to the old area, the memory will not be freed until the object gets garbage collected from the old area which can take a very, very long time (and in the worst case you may have the process hit a memory limit without a garbage collection occurring as only the Java heap's behaviour will trigger garbage collection). ...
    (comp.lang.java.machine)
  • Re: how to enlarger Java heap size?
    ... Is there a way to tell Java on the command line to take as much heap ... size as the physical memory or the virtual memory of the computer ... You could write a helper application that detects the installed physical memory and then passes that along as it starts the Java process. ...
    (comp.lang.java.programmer)
  • Re: Heap and Memory Footprint
    ... memory associated), when the object is created memory is allocated in ... both the Java heap and the C native heap. ... hit a memory limit without a garbage collection occurring as only the ...
    (comp.lang.java.machine)
  • Re: PermGen, Garbage Collection and CPU utilization
    ... Memory and Java Heap Space. ... Learn what its upper and lower limit regions of usage are and allocate ...
    (comp.lang.java.programmer)
  • Re: Metafile EXTTEXTOUT record structure?
    ... So the engine must be pure java. ... The report templates are created in Word. ... >>> order in memory doesn't match the order of ExtTextOut API parameters. ...
    (microsoft.public.win32.programmer.gdi)