Getting CPU utilization of Java processes


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Getting CPU utilization of Java processes
# 1  
Old 10-06-2008
Getting CPU utilization of Java processes

Hi,

I have a java application running as a service in my unix Box. I want to test the CPU utilization and the Memory utilization of the app. I used top command and also the ps commands

This command is showing each thread in my app as a separate thread. So I have a lot of j9 entries.

Now my question is, if I get the utilization data of the parent process, will that give me the cummulative CPU and memory usage of my app ???

Are there any other tools which can be used to monitor java processes ??
# 2  
Old 10-06-2008
I don't know if there are any tool exclusively for java.

But I am pretty sure that utilization of parent process won't give you cumulative measurements. Of course you can use ps and calculate it yourself by each process.
# 3  
Old 10-06-2008
If the java processes are the only service on this box use vmstat (the CPU-related columns). Alternatively use sar, when you need to monitor longer time intervals.

I hope this helps.

bakunin
# 4  
Old 10-07-2008
You can monitor these kinds of statistics, and more, with Java Management Extensions (JMX). Because the Java Virtual Machine has specific quirks with how memory is utilized (say, separating the memory space into partitions such as heap and non-heap space), just looking at the OS-level resource utilization is not generally adequate. Depending on how you configure, you may either monitor a local process or a Java process running on another system, via a graphical user interface tool such as JConsole (or VisualVM although I cannot get it run properly).

With JMX, you can even write some simple Java program to log selected statistical values periodically on a 24x7 basis and analyse them later offline.

You can refer to this document for an introduction of Java SE management and JMX technology:

- Java SE Monitoring and Management Guide

Or read the JMX specification if you wish to get more in-depth programming knowledge.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

CPU Utilization and Memory Utilization of Services and Applications

Hi, i am new to linux/RHEL 6.0 and i have two questions. 1) How to get the CPU utilization and Memory Utilization of all Services running currently? 2) How to get the CPU utilization and Memory Utilization of all Applications running currently? Please help me to find the script. ... (2 Replies)
Discussion started by: nossam
2 Replies

2. UNIX for Advanced & Expert Users

CPU utilization between 2 processes at an instant

I have a scenario where 2 applications(sever,deploy) are running in parallel....Now in a span of 1hr i want to know exact %CPU(user CPU) these are using. For example: for a snap shot of 1 hr say 10 am to 11 am i need the CPU utilization as below Total CPU=100 -->User... (1 Reply)
Discussion started by: niteesh_!7
1 Replies

3. UNIX for Advanced & Expert Users

CPU utilization by processes

OS is HP Number of CPU available is 4 I am running 8 multiple parallel application processes. I observed that the application is NOT able to occupy maximum CPU. Out of 4, 2 of them are used by 89% and 11% respectively. Where as other two are always sitting idle. Can anyone please comment... (3 Replies)
Discussion started by: sbiswas
3 Replies

4. Shell Programming and Scripting

script to check high cpu utilization for java process

Hello Team, I need help in preparing script to check for high cpu utilisation for java process. I have many java process on my system which consumes high cpu so i have to monitor it using script. ---------- Post updated 12-10-10 at 02:21 AM ---------- Previous update was 12-09-10 at... (1 Reply)
Discussion started by: coolguyamy
1 Replies

5. Shell Programming and Scripting

CPU Utilization

I know how to check the CPU utilization and memory space like: vmstat top free What i want ot check on my linux system is... how much CPU are available on my system and do i need to put extra CPU. Also need to check the hardware configuration and the space related to the same ... (3 Replies)
Discussion started by: j_panky
3 Replies

6. Shell Programming and Scripting

Check for the Processes in Unix and also CPU utilization

What is the command for checking all the processes running on UNIX. Alos can any one share the CPU utilization script to know what are all the processes running and what is the cpu utilization ... thanks in advance Perla Mohan (3 Replies)
Discussion started by: perlamohan
3 Replies

7. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

8. Shell Programming and Scripting

CPU Utilization

Hi to All, Would you please help me. I would like to know, In Unix How to know CPU utilization for every process. Thanks in Advance. Thanks, Divyang (3 Replies)
Discussion started by: div_Neev
3 Replies

9. Shell Programming and Scripting

CPU Utilization

Dear friends, I am doing a report daily for all most 30 more serves... i need to check out CPU utlization bu (top command, 100 - (ideal value)) and Memory utilization too could some one help me how can i get it directly, if scripts also no problem.. i will very thankful if some one... (3 Replies)
Discussion started by: bullz26
3 Replies

10. UNIX for Dummies Questions & Answers

% CPU utilization

Hi, iam new to AIX and had a basic question. I was asked to give a chart of CPU utilization in percentage for every hour. where can i look for information and which column should i look at? I would be very thankful if somebody could respond. Thanks! karthik (1 Reply)
Discussion started by: karthikosu
1 Replies
Login or Register to Ask a Question