I'm using eclipse IDE on Ubuntu Linux.
I need to profile Java programs with following metrics
execution time
System time
User time
memory usage
page faults
context switches
how can I do That?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I'm using eclipse IDE on Ubuntu Linux.
I need to profile Java programs with following metrics
execution time
System time
User time
memory usage
page faults
context switches
how can I do That?
The JVM is a process like any other - some of those metrics are only valid for the underlying OS. 'top', 'ps', 'time' would be good places to look
what are those where should I look those?'top', 'ps', 'time' would be good places to look
They're command line tools. 'top' gives you an automatically-refreshing view of all the processes and the resources they're using, plus some aggregate statistics. 'ps' can be invoked a lot of different ways and gives you a list in process-id order. See 'man ps' for more help on ps arguments. 'time' can be used to get a record of how long a Java process took, in terms of user time, wall time and system time. Use it like 'time java MyProgram'.
If you want something visual, try jconsole and jvisualvm - although since they operate at the JVM level and up, they won't give you precisely what you asked for. In Ubuntu System..Administration..System Monitor also has a process list which can give you some per-process stats as well as memory maps and open files in the 'Processes' tab.