Results 1 to 7 of 7
  1. #1
    fcbman is offline Member
    Join Date
    Jan 2016
    Posts
    3
    Rep Power
    0

    Default How to analyze a java process

    Hi everyone,

    I'm looking for ways to analyze a java process. All the process, NOT the heap.

    We have some java processes that the heap is 1G stable, but the process is 20G and we would like to know what in the process is taking it....
    (Perm is 256K there are 200 threads with Xss of 1M (total 200M)... so it seems very interesting for us).

    Is anyone familiar with a way hoe to investigate the process and not the heap?

    Thanks,
    Ori

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: How to analyze a java process

    I don't understand. The heap is 1g and the process is 20g. Where do you see that 20g? What is your -Xmx setting?

    I am a fan of JProfiler (shameless link here). It integrates very nicely with my IDE (another shameless link here). Go check out JProfiler and see if it fits your need.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: How to analyze a java process

    Also, check out 'jconsole', it comes with your jdk and can show different aspects of your java processes.

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  4. #4
    fcbman is offline Member
    Join Date
    Jan 2016
    Posts
    3
    Rep Power
    0

    Default Re: How to analyze a java process

    As mentiones -Xmx is 1G and no issue with it...

    we see the process is actually taking 20G (in VIRT)

    Thanks

  5. #5
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: How to analyze a java process

    Can you show a screenshot that is the root of your assumption, showing the 20g? Because I'm confused about your terminology, and we should clear that up first.

    Your JRE process wil never be able to get more memory than the -Xmx setting. If it needs more but can't, it will bomb out with an OutOfMemoryError.

    Try firing up jconsole as Jos suggested. There is a VM summary page in there. Paste a screenshot of that too.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  6. #6
    fcbman is offline Member
    Join Date
    Jan 2016
    Posts
    3
    Rep Power
    0

    Default Re: How to analyze a java process

    Hi SurfMan,

    That is not correct.
    The -Xmx is the limit ONLY for the java heap size.
    The java process size can be higher than the -Xmx value... you can read a lot about it other locations.

    The process size of a Java program is not only determined by
    the Java heap size:
    -Xmx: Java object heap

    Java needs much more memory for
    -XX:PermSize, -XX:MaxPermSize: Java heap for Java classes
    -Xss: stack memory for Java threads

    Furthermore (on the native side of the application):
    - stack memory for native threads (VMThread, GC threads, Finalizer, ...)
    - native libraries loaded into process address space
    - native heap memory (heap for native objects)

    Hence in our case the heap size is stable on 1G... but total process size is 20G.
    This can be seen in top command (under VIRT tab).

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: How to analyze a java process

    And what is the process?
    A normal Java application does not get much larger than its heap + perm.
    By no means 20 times larger.
    The 200 threads are, what, 200Mb? So not them.

    What is the app?
    What does it do?
    Is there some JNI aspect to it?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Troublesome input to analyze
    By Ace in forum New To Java
    Replies: 4
    Last Post: 05-11-2012, 01:52 AM
  2. how to analyze Java code
    By mmbathan in forum New To Java
    Replies: 1
    Last Post: 03-14-2011, 08:22 AM
  3. I cant analyze this code
    By eng_hyzoom in forum New To Java
    Replies: 6
    Last Post: 11-20-2010, 06:33 PM
  4. Analyze the SCJP Exam pattern for good score
    By kumarfair30 in forum Java Certification
    Replies: 0
    Last Post: 11-02-2009, 01:32 PM
  5. Analyze a string of words
    By zoe in forum Advanced Java
    Replies: 2
    Last Post: 07-26-2007, 10:01 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •