Heap size not growing up to max value ?

A

aarg

Hello,

One app running java does the out of memory error :

<GC: totally out of heap space>java.lang.OutOfMemoryError

At this moment the GC log reads :

<GC: freed 0 objects, 0 bytes in 137 ms, 19% free (2960224/15346880)>

The way i understand this, it means a max size of 15346880 bytes. I
graphed this max size against time and it reaches this max value very
shortly after the launch of the java process.

My problem is : this process is launched with the -Xmx512m option :
there should be more than enough space to extend the size of the heap.

Why is it that the max size is not reached and still it crashes saying
it has no more memory when it should at least try to expand the size ?

Thanks for any help,


Dav'
 
P

Paul Lutus

aarg said:
Hello,

One app running java does the out of memory error :

<GC: totally out of heap space>java.lang.OutOfMemoryError

At this moment the GC log reads :

<GC: freed 0 objects, 0 bytes in 137 ms, 19% free (2960224/15346880)>

The way i understand this, it means a max size of 15346880 bytes. I
graphed this max size against time and it reaches this max value very
shortly after the launch of the java process.

My problem is : this process is launched with the -Xmx512m option :
there should be more than enough space to extend the size of the heap.

Why is it that the max size is not reached and still it crashes saying
it has no more memory when it should at least try to expand the size ?

Most likely because the JVM ran out of memory between calls to the memory
size determination method. Surely you don't expect all system properties to
be accurately reported after a complete meltdown, do you? If the JVM is out
of memory, one of the many things it can no longer do is report how much
memory is available.

Instead of puzzling over this non-quandary, why not address the original
problem, the one that caused you to run out of memory?
 
T

Tor Iver Wilhelmsen

Why is it that the max size is not reached and still it crashes saying
it has no more memory when it should at least try to expand the size ?

Depends on how large object you try to create: This call, for
instance, will try to allocate 2.1 gigabytes:

byte[] wontwork = new byte[Integer.MAX_VALUE];
 
N

Nigel Wade

Hello,

One app running java does the out of memory error :

<GC: totally out of heap space>java.lang.OutOfMemoryError

At this moment the GC log reads :

<GC: freed 0 objects, 0 bytes in 137 ms, 19% free (2960224/15346880)>

The way i understand this, it means a max size of 15346880 bytes. I
graphed this max size against time and it reaches this max value very
shortly after the launch of the java process.

My problem is : this process is launched with the -Xmx512m option :
there should be more than enough space to extend the size of the heap.

Why is it that the max size is not reached and still it crashes saying
it has no more memory when it should at least try to expand the size ?

Thanks for any help,


Dav'

Besides the other reasons posted in reply, there may be an OS imposed
limit on the size of the process. Although you've told the JVM that it can
have 512MB, does the OS allow it to have this much? It might be that the
JVM is requesting more memory and the OS is refusing.
 
A

aarg

Besides the other reasons posted in reply, there may be an OS imposed
limit on the size of the process. Although you've told the JVM that it can
have 512MB, does the OS allow it to have this much? It might be that the
JVM is requesting more memory and the OS is refusing.

Hello,

Thanks you all for your answers !

I checked ulimit :

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 131072
stack(kbytes) 4096
memory(kbytes) 2049992
coredump(blocks) unlimited
nofiles(descriptors) 4096
vmemory(kbytes) 1048576


It seems ok to me since memory and vmemory are way over 512Mb.
It's on a digital osf1 v4.0 and jvm is 1.3.1

Dav'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top