1828670 Members
2198 Online
109984 Solutions
New Discussion

Java RTE memory usage

 
alonana
Occasional Contributor

Java RTE memory usage

Hi!

I have an HP 11.31 ia64 machine which runs several Java based agents. The processes use ~200M memory. This is also reflected in the Runtime.totalMemory(). However in using `topas` command shows private memory usage is ~200M, but the the total memory usage is ~600M. How can this be?
5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: Java RTE memory usage

>using topas command shows private memory usage is ~200M, but the the total memory usage is ~600M. How can this be?

No topas on HP-UX, only top(1).
You shouldn't trust top(1) correct stats, only glance. 600 Mb maybe shared memory or text?
alonana
Occasional Contributor

Re: Java RTE memory usage

Hi Dennis!

You are right, I used top, not topas.
I understand that this is shared memory/text, but the question is why? Is this WAD that a java process which uses 200M (according to Runtime.totalMemory) consumes 600M?
Dennis Handly
Acclaimed Contributor

Re: Java RTE memory usage

>but the question is why?

top(1) is notoriously inaccurate, don't look at it for accurate results.
What are you really trying to find out?

>Is this WAD that a java process which uses 200M consumes 600M?

You are going to have to explain WAD, Works As Designed?
alonana
Occasional Contributor

Re: Java RTE memory usage

I am also using `vmstat -tm` which shows that starting the java process uses about the same amount specified in top.

WAD = Work as design

I am trying to find out is this a problem that each simple java based process uses 600M of (swap) memory. This was not the case in RTE 1.4.2 where each process used about 250M. Is this change in RTE? Is there a JVM argument I should change?
BTW - I've create empty loop test program and it also uses about 500M memory.
It seems weird to me that to run 10 simple java processes I need 5G swap.
James R. Ferguson
Acclaimed Contributor

Re: Java RTE memory usage

Hi:

> I am trying to find out is this a problem that each simple java based process uses 600M of (swap) memory. This was not the case in RTE 1.4.2 where each process used about 250M. Is this change in RTE? Is there a JVM argument I should change?

Using 'glance' will provide the best metrics for a process since 'glance' is architected for the HP-UX kernel. Glance also better accounts for any ahared-memory than tools like 'top' as already noted.

I would read the release notes for the Java RTE you are currently running. Perhaps the default heap size has changed between the releases you are comparing.

> BTW - I've create empty loop test program and it also uses about 500M memory.
It seems weird to me that to run 10 simple java processes I need 5G swap.

Well, Java is a notorious memory hog :-}

Regards!

...JRF...