Getting starnge memory error

Z

zigzagdna

I am on HP UNIX 11.2 and on JDK 1.5. My sever has 24 GB of memory
and of that 15GB is free when I see in glance.

I have a very simple java program. Simply does a difference in two
times.
When I run this give program, I get outofMemory error or no pace to
allocate heap memory:
“Error occurred during initialization of VM
Could not reserve enough space for object heap”

It is clearly not a memory issue but some thing else in HP UNIX. Not
sure, what it is?

Thanks.
 
Q

Qu0ll

zigzagdna said:
I am on HP UNIX 11.2 and on JDK 1.5. My sever has 24 GB of memory
and of that 15GB is free when I see in glance.

I have a very simple java program. Simply does a difference in two
times.
When I run this give program, I get outofMemory error or no pace to
allocate heap memory:
“Error occurred during initialization of VM
Could not reserve enough space for object heap”

It is clearly not a memory issue but some thing else in HP UNIX. Not
sure, what it is?

It sounds like some parameters relating to memory allocation are being
passed to the JVM such as -Xmx which are specifying amounts greater than the
2GB limit or which have an error in the amount specified. It doesn't matter
that you have > 15GB free RAM as 32-bit Java (if you are using that) cannot
use it all.

I suggest you check that the java command is not aliased to something which
passes those parameters and, if it is, check that the -Xmx or -Xms
parameters specify valid values. It may simply be that there is a typo in
the command.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
 
Z

zigzagdna

I  am  on HP UNIX 11.2 and on JDK 1.5.  My sever has 24 GB of memory
and of that 15GB is free when I see in glance.
I have a very simple java program. Simply does a difference in two
times.
When I run this give program, I get outofMemory  error or no pace to
allocate heap memory:
“Error occurred during initialization of VM
Could not reserve enough space for object heap”
It is clearly not a memory issue but some thing else in HP UNIX. Not
sure, what it is?

It sounds like some parameters relating to memory allocation are being
passed to the JVM such as -Xmx which are specifying amounts greater than the
2GB limit or which have an error in the amount specified.  It doesn't matter
that you have > 15GB free RAM as 32-bit Java (if you are using that) cannot
use it all.

I suggest you check that the java command is not aliased to something which
passes those parameters and, if it is, check that the -Xmx or -Xms
parameters specify valid values.  It may simply be that there is a typo in
the command.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]

Is 2GB limit for all the java processes comvined or for each java
process. I know in Windows 32 bit, it is combine dmemory of all java
processes plus any other process on the system. But this is HP UNIX 64
BIT. I am running many oracle instances which have ther own jvm's.
That's why asking this question.

I am using default parameters of java, i.e., simply using java
command.
 
M

markspace

zigzagdna said:
Is 2GB limit for all the java processes comvined or for each java
process. I know in Windows 32 bit, it is combine dmemory of all java


On Windows, it's per process. Each process can have about 1.6 G of
memory, and they won't fill up memory. (Each process will get swapped
out to disk though. That's what virtual memory does.)

I don't know HP-UX but I don't see why it would be different.

I am using default parameters of java, i.e., simply using java
command.


The default parameter is -Xmx64M, at least under Win32. That's really
small. You might try passing in -Xmx1G (not much more under Win32, the
JVM needs some space too) and see what happens. Your limit is likely to
be much higher on a 64 bit os -- I'd try some very large values just to
see what happens.
 
Z

zigzagdna

seehttp://mindprod.com/jgloss/runerrormessages.html#RESERVEOBJECTHEAP
--
Roedy Green Canadian Mind Productshttp://mindprod.com

If everyone lived the way people do in Vancouver, we would need three more entire planets to support us.
~ Guy Dauncey

What is baffling to me is, on the UNIX server I have two UNIX logins
longin1 and login2.
Both login's have very similar environment variables.
a. For I use login1,
I type command java
it shows me java help with all java options which is correct behavior.


b: When I use login2,
I type java
I get:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Why login2 will consistently get the error while login1 does not.
In login2 when I use:
java -Xmx64M
I do get correct behavior of getting java command help, so it looks
like some memory issue.

Still when login1 and login2 are on same machine memory behavior
should be the same.

Really strange ..
 
Z

zigzagdna

On Windows, it's per process.  Each process can have about 1.6 G of
memory, and they won't fill up memory.  (Each process will get swapped
out to disk though.  That's what virtual memory does.)

I don't know HP-UX but I don't see why it would be different.


The default parameter is -Xmx64M, at least under Win32.  That's really
small.  You might try passing in -Xmx1G (not much more under Win32, the
JVM needs some space too) and see what happens.  Your limit is likely to
be much higher on a 64 bit os -- I'd try some very large values just to
see what happens.

Windows 32 bit is a 32 bit operating system but HP UNIX is 64 bit
poperating system. Each 32 bit program can only access 2GB memory but
I will be surprised if that is the case because then there is no point
getting all this memory when most of the applications are still 32
bit. I know Oracle is 64 bit so it can access lot more memory.
 
M

markspace

zigzagdna said:
Windows 32 bit is a 32 bit operating system but HP UNIX is 64 bit
poperating system. Each 32 bit program can only access 2GB memory but
I will be surprised if that is the case because then there is no point
getting all this memory when most of the applications are still 32
bit. I know Oracle is 64 bit so it can access lot more memory.


By "any different" I meant that it should be able to allocate a
significant percentage of the address space to JVM heap. :)

Patrica has a good point: you may be allocating too much memory. Check
environment variables, etc. See if there's a default being configured
somewhere.
 
Q

Qu0ll

Patricia Shanahan said:
Try "which java" on each login, and also check each login's aliases.

I very strongly suspect that login2 has something imposing a default
-Xmx parameter that is too big for a 32 bit JVM.

....or an invalid amount. I have seen this problem when there is a typo in
the memory specification. You only need to enter something like -Xmx512MB
to get this symptom if I recall correctly.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
 
Z

zigzagdna

Try "which java" on each login, and also check each login's aliases.
I very strongly suspect that login2 has something imposing a default
-Xmx parameter that is too big for a 32 bit JVM.

...or an invalid amount.  I have seen this problem when there is a typo in
the memory specification.  You only need to enter something like -Xmx512MB
to get this symptom if I recall correctly.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]- Hide quoted text -

- Show quoted text -

I am using the default parameters, i.e., simply java command, I did
which java, it is same java for bboth logins...
I am coming to conclusion that java is 32 bit and the limitation of
2GB or so applies to all jvm combined and not just single jvm. So
even if HP UNIX is 64 BIT and my box has 24 GB memory, to all jvm's
on that server only 2GB of heap memory available; so all the extra
memory is worthless.
 
J

John B. Matthews

zigzagdna said:
I am using the default parameters, i.e., simply java command, I did
which java, it is same java for bboth logins...

You might check the invoking shell's ulimit for each login: they may
differ depending on how each account was created.
I am coming to conclusion that java is 32 bit and the limitation of
2GB or so applies to all jvm combined and not just single jvm. So
even if HP UNIX is 64 BIT and my box has 24 GB memory, to all jvm's
on that server only 2GB of heap memory available; so all the extra
memory is worthless.

I am unable to reproduce this. All my JVMs appear to be separate. Is
this a widely seen limitation?
 
Q

Qu0ll

zigzagdna said:
I am using the default parameters, i.e., simply java command, I did
which java, it is same java for bboth logins...
I am coming to conclusion that java is 32 bit and the limitation of
2GB or so applies to all jvm combined and not just single jvm. So
even if HP UNIX is 64 BIT and my box has 24 GB memory, to all jvm's
on that server only 2GB of heap memory available; so all the extra
memory is worthless.

No, that conclusion is incorrect. The limitations are per JVM as each JVM
has no idea what the other ones are doing. It's not the OS or the machine
that imposes the limits and each JVM is independent.

If you are running the exact same program using the exact same java command
in each case on the same machine with one login having the problem and the
other not then the only explanation can be that there is an OS-level issue
with the java command in the case that's failing. There must be a command
alias or something else which is incorrectly setting the memory allocation
parameters to the JVM. I am not a Linux expert so I cannot provide much
further assistance in tracking down the exact nature of the issue but I feel
that the *actual* command that is being run when you type in "java" is
different for each login. All I can suggest is that you try to enter the
full path to the java command (something like /usr/java/bin/java) and, if
that fails, try looking for symbolic links at that location or aliases in
your .bashrc equivalent.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
 
Z

zigzagdna

It certainly does not apply on WindowsXP - at the time I was writing one
of my messages in this thread, I had 12 jobs, each with -Xmx700m,
running on a 32 bit JVM.

Although I don't have access to a suitable system to retest it, I
believe I have done similar things on large memory Sparc Solaris systems
using 32 bit JVMs. For example, I've used a 64 processor system to run
60 large Java CPU-bound jobs in parallel (I was required to leave a few
processors free for another users). I've never had problems related to
the total memory of all Java jobs, just the memory of an individual job.

Patricia

1. Keep in mind -Xmx is the maximum memory which process can have not
necssarily the memory used by the heap. You should have done a test
with -Xms700M -Xmx700M so process is taking that much memory when it
starts.
2. I learnt from HP folks that on 64 bit HP UNIX:
The maximum memory limit for 32 bit process data is 3.8 Gb if fourth
quadrant is enabled .

But this 3.8 GB is shared among all 32 bit programs ,so the total data
space of all 32bit process will be the maximum of only 3.8 GB.
 
L

Lew

zigzagdna said:
1. Keep in mind -Xmx is the maximum memory which process can have not
necssarily the memory used by the heap.

According to the documentation for 'java',
-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool.

The "memory allocation pool" is the heap, and does not include, for example,
the memory used by the JVM itself. So the amount specified by "-Xmx" is not
the whole process's but just that part dedicated to memory allocation.
 
N

Nigel Wade

zigzagdna said:
1. Keep in mind -Xmx is the maximum memory which process can have not
necssarily the memory used by the heap. You should have done a test
with -Xms700M -Xmx700M so process is taking that much memory when it
starts.

-Xmx specifies the maximum memory available for the JVM heap. It's nothing to
do with the maximum memory available to the program as a whole.
2. I learnt from HP folks that on 64 bit HP UNIX:
The maximum memory limit for 32 bit process data is 3.8 Gb if fourth
quadrant is enabled .

But this 3.8 GB is shared among all 32 bit programs ,so the total data
space of all 32bit process will be the maximum of only 3.8 GB.

From my cursory searching regarding HPUX on Itanium that would be my conclusion.
Either it's a limitation of HP-UX or the memory model used to run 32bit apps.
on the 64bit-only Itanium. The Itanium has no 32bit mode, 32bit apps. have to
run in a separate environment or via an emulation layer. It almost looks as
though HP-UX runs them in a separate virtual machine with a max. of 4GB memory
(for the entire VM).

If there is a 64bit JVM available for HP-UX that would be your best solution.
Does your JVM have the -d32 and -d64 options?
 
A

Arne Vajhøj

Nigel said:
-Xmx specifies the maximum memory available for the JVM heap. It's nothing to
do with the maximum memory available to the program as a whole.


From my cursory searching regarding HPUX on Itanium that would be my conclusion.
Either it's a limitation of HP-UX or the memory model used to run 32bit apps.
on the 64bit-only Itanium. The Itanium has no 32bit mode, 32bit apps. have to
run in a separate environment or via an emulation layer. It almost looks as
though HP-UX runs them in a separate virtual machine with a max. of 4GB memory
(for the entire VM).

If there is a 64bit JVM available for HP-UX that would be your best solution.
Does your JVM have the -d32 and -d64 options?

http://docs.hp.com/en/JAVAPROGUIDE/hotspot.html

says it has.

Arne
 

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

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top