Operating System - HP-UX
1832654 Members
3388 Online
110043 Solutions
New Discussion

Monitoring and controlling memory usage of Java instances

 
kcw
Advisor

Monitoring and controlling memory usage of Java instances

Hi everyone,
Does anyone know that how can I monitor a number of Java instances and see if they are consuming too much memory resources?? Also, can I control the memory usage of them?? Many thanks

Best Regards
KCW
10 REPLIES 10
Safarali
Valued Contributor

Re: Monitoring and controlling memory usage of Java instances

ps -eaf | grep java | wc -l

Regards

Safar
Jeeshan
Honored Contributor

Re: Monitoring and controlling memory usage of Java instances

export UNIX95=1;ps -ef -o comm,pcpu,vsz,args | grep java

it will show the cpu % and memory in KB size.
a warrior never quits
Dennis Handly
Acclaimed Contributor

Re: Monitoring and controlling memory usage of Java instances

Have you looked into HPjmeter and the various java heap and garbage collection options?
http://www.hp.com/go/java
Yogeeraj_1
Honored Contributor

Re: Monitoring and controlling memory usage of Java instances

hi KCW,

>Also, can I control the memory usage of them??

For this you will have to define appropriate parameters at the application level itself. What type of application are you running?


revert!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Steven E. Protter
Exalted Contributor

Re: Monitoring and controlling memory usage of Java instances

Shalom,

http://www.hpux.ws/?p=8

Ultimately you will identify processes and this will lead back to the java code.

Nice to know however who the offending processes are.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
kcw
Advisor

Re: Monitoring and controlling memory usage of Java instances

Hi Yogeeraj,

Thanks for your help, it is running J2EE, details as below:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.10-060112-14:28)
Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.10-060112-19:42-IA64N IA64, mixed mode)


Best Regards
KCW
kcw
Advisor

Re: Monitoring and controlling memory usage of Java instances

Dear all,
Attached please find the glance report of the server, again, thank you very much for your great help!!

Best Regards
KCW
Yogeeraj_1
Honored Contributor

Re: Monitoring and controlling memory usage of Java instances

hi KCW,

For java applications, we can control the heap size at the command Line level.

Available switches are:
-Xms64m -Xmx512m
-Xms is for initial heap size
-Xmx is for maximum heap size

NB. The default for ms and mx is 64 MB (64m).

hope this helps!
kind regards,
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
kcw
Advisor

Re: Monitoring and controlling memory usage of Java instances

Dear all and Yogeeraj,
Do you think the memory usage is too high (please kindly see the attachment) for the machine?? As it always indicate that 99% usage of memory. Thanks

Best Regards
Sunny Lo
Yogeeraj_1
Honored Contributor

Re: Monitoring and controlling memory usage of Java instances

Hi Sunny Lo,

with the limited amount of information available about your system, it is quite difficult to get the global picture here.

Indeed some of the java processes are using an 'abnormal' amount of memory compared to other java processes on the same system.

Did you look into: HPjmeter ?

Since you have glance, you could just drill-into the top processes and check the resources etc...

What type of application is it? Oracle? If yes, why don't you log a service request so that the metalink analyst look into the issue more deeply.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)