Operating System - HP-UX
1819681 Members
3499 Online
109605 Solutions
New Discussion юеВ

VM Size greater than allocated for a Java Heap

 
SOLVED
Go to solution
Paddy_1
Valued Contributor

VM Size greater than allocated for a Java Heap

Hi,

We have an rp class box with 2 gig of RAM. The machine is extremely slow to work with.

As usual we started running glance and we see that memory utlisation is almost always at 95,99 or 100%. The system runs approximately 10 Java Virtual Machines of varying sizes but none exceeding 256 M.

The interesting part is that inspite of limiting the maximum amount of memory that can be consumed by a Java process say 256, the VSS column reports a consisten use of 450 M. I might be missing something elementary out here in explaining this phenomenon.

Any stab at explaining the behavior is greatly appreciated.

Thanks
Paddy
The sufficiency of my merit is to know that my merit is NOT sufficient
11 REPLIES 11
RAC_1
Honored Contributor

Re: VM Size greater than allocated for a Java Heap

How do you limit the memory that will be used by JVM?? (you control that with initial heap size, max heap size options on java command line.)
Are you doing that?? Check both sizes - initial heap size and max. heap size.

Also you should be up to date on java patches.

Anil
There is no substitute to HARDWORK
Paddy_1
Valued Contributor

Re: VM Size greater than allocated for a Java Heap

Anil,

Yes. We use the java command line of -Xmn and -Xmx to set the initial and max heap size.The current values are 0 and 256.I experimented with increasing the minimum size which only reflected a change in the RSS but no effect on the VSS.

I am not sure of the lastest HotSpot Patch on HP.The following is my output of java -version
-----------------
java version "1.3.1.13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.13-040210-15:41)
Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.13-_10_feb_2004_17_15 PA2.0, mixed mode)
--------------


The sufficiency of my merit is to know that my merit is NOT sufficient
RAC_1
Honored Contributor

Re: VM Size greater than allocated for a Java Heap

what is the output of the following.

ps -efx|grep [j]ava

This would show the values you used on command line.

Anil
There is no substitute to HARDWORK
Paddy_1
Valued Contributor

Re: VM Size greater than allocated for a Java Heap

I am attaching the output as a file since there are too mahy and mostly the minimum setting is 50 M and max of 256M.

The sufficiency of my merit is to know that my merit is NOT sufficient
Paul Torp
Regular Advisor

Re: VM Size greater than allocated for a Java Heap

hi.. i have recently been at a preformance course in websphere..

U should use PRM and WLM and have one java-prosess stuck at a single cpu.

Java should NEVER swap.

One could also look at the Garbage collectors in the j2ee environment..

Typical for a badly written java application is that it collects objects until one reaches the memomory limit, and then it uses ALL resouces to delete the objects it has collected..

typical indication is running top and look at the load-average compared to idle.

if load-average is high and idle is good u have a GC problem.

paul
"sendmail is kind of fun..."
RAC_1
Honored Contributor
Solution

Re: VM Size greater than allocated for a Java Heap

The last process in your attachment, has option -xms50m, (50 mb) it certainly does not have option for max heap size. you need to start that processes with max. heap size option.

The other three processes are old.

Anil
There is no substitute to HARDWORK
Paddy_1
Valued Contributor

Re: VM Size greater than allocated for a Java Heap

Anil,

For the last process After the URL Protocols jar file you'll find the -Xmx directive of setting to 256M (I admit that visually its kinda confusing.

Meanhwile I have asked my system folks to upgrade the system with the attached list of patches. I have got this list after running HPjconfig.Some of them are present already but some missing.
The sufficiency of my merit is to know that my merit is NOT sufficient
Dietmar Konermann
Honored Contributor

Re: VM Size greater than allocated for a Java Heap

Paddy,

I think what you're seeing is quite usual for JVMs. First of all VSS is the virtual set size... if you see memory bottlenecks then you should have a look at the resident set size (RSS)!

However, if you look at the memory regions in Glance you should see that the largest (VSS) regions are of type "MEMMAP/Priv". These memory mapped files are used for JVM internal memory management and they are allocated using mmap()'s MAP_NORESERVE flag... which means even no waste of swap due to layz swap allocation.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Paddy_1
Valued Contributor

Re: VM Size greater than allocated for a Java Heap

Thanks.That might be interesting as the problem might be somewhere else then.If thats true I am looking at the wrong problem..

How come the same behavior isnt reflected in AIX ..(probably the jvm implementations, I guess)...

The sufficiency of my merit is to know that my merit is NOT sufficient
Paul Torp
Regular Advisor

Re: VM Size greater than allocated for a Java Heap

points-assignment would be nice.. tnx in advance.
"sendmail is kind of fun..."
Ng Jiunn Jye
New Member

Re: VM Size greater than allocated for a Java Heap

Hi Paddy,

I am experiencing the same problem now. Have you got the answer to this problem.

For my case, I have JVM running on both 1.3.1.13 and 1.4.2.03. The problem happened to both JVM on itanium machine. Testing on an other HP machine does not show this behaviour. The memory is limited to 100m (-Xmx100m) but TOP show java is taking up to 900m. This cause the system to run out of memory and the application need to be restated periodically.

Please advise.

Thank you

Rgds,
jay