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.

Results 1 to 5 of 5

Thread: profiling java programs in eclips (Linux Ubuntu)

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default profiling java programs in eclips (Linux Ubuntu)

    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?


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: profiling java programs in eclips (Linux Ubuntu)

    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

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: profiling java programs in eclips (Linux Ubuntu)

    'top', 'ps', 'time' would be good places to look
    what are those where should I look those?

  4. #4
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: profiling java programs in eclips (Linux Ubuntu)

    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'.

  5. #5
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: profiling java programs in eclips (Linux Ubuntu)

    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.

Similar Threads

  1. Replies: 2
    Last Post: July 12th, 2011, 07:24 AM
  2. How to install the JDK on Ubuntu Linux
    By Brt93yoda in forum Java JDK & IDE Tutorials
    Replies: 2
    Last Post: July 9th, 2011, 08:18 AM
  3. Replies: 1
    Last Post: June 7th, 2011, 12:53 PM
  4. How to install the JDK on Ubuntu Linux
    By Brt93yoda in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: June 5th, 2011, 10:09 AM
  5. Replies: 2
    Last Post: February 14th, 2011, 02:32 AM