GC stats for 1.4.2 JVM on AIX - Websphere

This is a discussion on GC stats for 1.4.2 JVM on AIX - Websphere ; Hi, I've been working on a method to allow me to collect GC stats from a 1.4.2 JVM (WAS 6.0) running on AIX. I have a big constraint in that I wasn't able to restart any of the JVM's so ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: GC stats for 1.4.2 JVM on AIX

  1. GC stats for 1.4.2 JVM on AIX

    Hi,

    I've been working on a method to allow me to collect GC stats from a 1.4.2 JVM (WAS 6.0) running on AIX.

    I have a big constraint in that I wasn't able to restart any of the JVM's so turning on verbose GC isn't an option.

    The big shock to me was that jvmstat didn't work, it appears that the JVM for AIX isn't instrumented like the Solaris one is.

    To get around this I've come up with a method using wsadmin, but It's really heavyweight and I'm uncomfortable with this approach.

    Does anyone know of jvmstat type utility for the AIX JVM (1.4.2) that I can use ?

  2. Re: GC stats for 1.4.2 JVM on AIX

    Hi, The jvmstat is part of the HotSpot JVM from Sun Microsystem. IBM's JVM has similar tools, but not exactly the same. You could make your own JMX client, but you might want to check out this tool and see if it helps you:

    IBM Pattern Modeling and Analysis Tool for Java Garbage Collector
    http://www.alphaworks.ibm.com/tech/pmat

    You could also use the PMI stats from the WebSphere Console.

    Regards,
    Brian

  3. Re: GC stats for 1.4.2 JVM on AIX

    Hi,
    Thanks for the response.... wont be able to use the pmat tool as it requires the presence of verbose GC stats. My challenge is to somehow retrieve GC stats from an existing estate of approx 200 instances (ND) without restarting any of them. then I need to suck the GC data into a central location to graphed by Ganglia. To be honest, if verbose GC was already on and stats were being dumped my job would be very simple.

    Even a JMX client wont do the trick because I'll need to enable remote JMX connectivity and restart the JVM (I think i'm right in this part, please correct me if not)

    One way to solve this is use wsadmin, however this has drawback given my requirement is to dump GC stats continuously. Doing this by prodding wsadmin frequently is not a good idea because wsadmin uses a huge amount of computer resource to start up. This being the case I came up with a solution whereby a JACL script continuously loops around invoking getFreeMemory on the relevant JVM references obtained using the $AdminControl object in wsadmin. It's not an elegant solution, but it's all I can think of right now.

    Code below.... any help MUCH appreciated

    # First arg is output file
    set out_file_name [lindex $argv 0]
    set out_file_handle [open "$out_file_name" w]

    # List all servers
    set servers_a [$AdminConfig list Server]

    # Get the MAX heap setting for all servers and place it in an associative array
    # No need to query this in the loop because it's static
    foreach server_a $servers_a {
    set name_a [$AdminConfig showAttribute $server_a name];
    set server_obj_name_a [$AdminConfig getObjectName $server_a ];
    if {$server_obj_name_a != ""} { s et server_jvm_a [$AdminControl invoke $server_obj_name_a getJavaVMs];
    set max_heap($name_a) [$AdminControl invoke $server_jvm_a getMaxMemory];
    puts $out_file_handle "Initialised array for max heap settings with name : $name_a and value : $max_heap($name_a)"
    }
    }

    # Now loop forever every 10 mins and dump used memory to the file specified by $args[0]
    set i 0
    while {$i 1} {
    set servers [$AdminConfiglist Server]
    foreach server $servers {
    set name [$AdminConfig showAttribute $server name]
    set server_obj_name [$AdminConfig getObjectName $server]
    if {$server_obj_name != ""} {
    set server_jvm [$AdminControl invoke $server_obj_name getJavaVMs]
    set timestamp [clock format [clock seconds]]
    set fm [$AdminControl invoke $server_jvm getFreeMemory]
    puts -nonewline $out_file_handle $timestamp
    puts -nonewline $out_file_handle ":::"
    puts -nonewline $out_file_handle "jvm=$name"
    puts -nonewline $out_file_handle ":::"
    puts $out_file_handle "used_mem=$fm"
    puts -nonewline $out_file_handle $timestamp
    puts -nonewline $out_file_handle ":::"
    puts -nonewline $out_file_handle "jvm=$name"
    puts -nonewline $out_file_handle ":::"
    puts $out_file_handle "max_mem=$max_heap($name)"
    flush $out_file_handle
    }
    }
    after 600000
    }

  4. Re: GC stats for 1.4.2 JVM on AIX

    Hi, You can use a JMX client either remote or local to each JVM without restarting the JVMs. You need to make sure that the PMI Stats are on Basic on each App Server, which can be done at runtime.

    I had a similar situation recently and had to write a small JMX application to pull some stats. When sitting in the JVMs it does not take up a large amount of resources. I hooked it up to a TimerManager to go off every x seconds and record the stats in a Database.

    Regards,
    Brian

  5. Re: GC stats for 1.4.2 JVM on AIX

    Hi,

    This is significant news, I hadn't realized you could get access via JMX without a restart, thanks for the tip.

    I dont suppose you have the code handy do you ?

    cheers,
    Bob

  6. Re: GC stats for 1.4.2 JVM on AIX

    Hi, There is an article and example here:

    link: [http://www.ibm.com/developerworks/we...402_qiao.html]

    If you want to use a client within the JVM container you do not need to use the connection lines and just use the AdminService class:

    {code}
    AdminService adminService = AdminServiceFactory.getAdminService();
    {code}

    I cannot release my code just yet, but hopefully in a few weeks after I clean it up for an article I am writing.

    Regards,
    Brian

+ Reply to Thread