Find out current old heap usage from within the process

Hello!
We use the CMS garbage collector and need a way to find out how much memory is used of the old heap by reachable objects. This we have to do from within the process (not using jvmstat or jstat etc.).
Since there is no way to distinguish between reachable and non-reachable objects (except for traversing the entire heap... -- or are there other possibilities?) our idea is to get the amount of used memory right after a garbage collection in the old heap.
Using Java 1.5, this can be done by
java.lang.management.MemoryPoolMXBean pool = <Pool for Old Generation>;
pool.getUsage().getUsed();However, java.lang.management is only available in Java 1.5.
Therefore my first question: Is there a similar way of finding out old heap usage in Java 1.4?
There is another problem with this method: By calling pool.getUsage().getUsed();, one has to know when a GC has occurred (this could be done by calling it in an interval of x seconds -- if the current value is lower than the one before, a GC must hava occurred). A better way would be to use pool.getCollectionUsage().getUsed();, but this seems not to work for the CMS collector.
Second question: Is pool.getCollectionUsage().getUsed(); really not working with CMS, or are we just doing it in a wrong way? Are there other ways of finding out the used memory in the old heap after a GC even when using the CMS?
Thanks for any help!
Regards,
Nicolas Michael

Hi Nicolas,
There is no API in 1.4 to get the after GC memory usage of the old generation. The only thing close to it is (Runtime.totalMemory - Runtime.freeMemory) but it is the approx amount of memory used for the heap (not just the old generation).
MemoryPoolMXBean.getCollectionUsage() returns the after GC MemoryUsage. This method should work for all collectors. I have a simple test case that shows it working fine with CMS. It shows the same value as the -XX:+PrintGCDetails shows.
If you have a test case showing that this method doesn't work correctly, please submit a bug along with the test case. We'll investigate it.
Thanks
Mandy

Similar Messages

  • Reset deadlines of intermediate timer events from within the process

    Hi
    Is it possible to manipulate a Task completion deadline from another Event or Activity?
    Example:
    Human-Activity 1 has completion deadline 28.06.2010 which is saved in a data object do_deadline
    Parallel, Human-Activity 2 has an output-mapping which resets  do_deadline to 13.06.2010.
    However, BPM does not recognice that do_deadline has changed after Human-Activity 2 has been executed and therefore does not change the deadline.
    Do I have to remodel the process flow in order to end and restart the task in order to set the new deadline datetime values or is it possible to modify them directly?
    Start
                           l
                           l
                           l
                  Parallel Splitt
                  l                  l
    Human-Activity 1    Human Activity 2
    Edited by: Jan Nyfeler on Jun 18, 2010 4:45 PM

    Hi Harsha
    Thanks, good to know that it does not work without restarting the task.
    Of course two parallel tokens are created, and depending on one activitiy's choice for instance I'd like to influence the second activities deadline.
    I did this with other BPM tools already but it actually makes sense that it does not work

  • HT1206 How do I find out an OLD password from 2006-2008. I have 3,000 pieces of music purchased from iTunes during those years that cannot be authorized because I cannot remember the password from that era. What can I do?

    How do I find out an OLD password from 2006-2008. I have 3,000 pieces of music purchased from iTunes during those years that cannot be authorized because I cannot remember the password from that era. What can I do?

    If you can't remember your password or security answers and don't have access to the email address (you didn't have a rescue email address on the account ?) then you can try contacting Support in your country and seeing if you can get the password reset and access to the account : http://support.apple.com/kb/HT5699 (they should also be able to reset the security questions)
    If you can then update the primary email address on the account to be an address that you have access to.

  • Currently logged in from within  the app itself

    I need to find out who or how many users are currently logged into my app from within the app itself and display it within a report for the app administrators. Any thoughts or ideas.

    For an answer to this question see this discussion.
    query apex users and their session
    query apex users and thier session
    Todd

  • How can you find out an individual image size from multiple images on a canvas

    This is probably a really really simple question but I can't for the life of me find how I can find out an individual image size from multiple images on a canvas. eg I have 3 photos i want to arrange 1 large and the other two next to it half the size. How can I edit individual image size on the canvas as when I select the image on a sperate layer I want to resize it just resizes the entire canvas and not the individual image
    Thanks

    I want to know they exact dimensions though. You can get them by dragging to the 0,0 corner and then reading off of the ruler scale on the sides but its fiddily as you have to zoom right in and work it out. I know in photoshop there is a ruler but is there any other way in Elements?

  • How to find out when data was deleted from table in oracle and Who deleted that

    HI Experts,
    Help me for below query:
    how to find out when data was deleted from table in oracle and Who deleted that ?
    I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
    SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
    TABLE_OWNER                    TABLE_NAME                        INSERTS    UPDATES    DELETES     TIMESTAMP         DROP_SEGMENTS TRU
    PRODCTL                        F9001                                                     1683         46       2171            11-12-13 18:23:39             0                   NO
    Audit is enable in my enviroment?
    customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
    SQL> show parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /oracle/admin/pbowe/adump
    audit_sys_operations                 boolean     TRUE
    audit_syslog_level                   string
    audit_trail                          string      DB, EXTENDED
    please help
    Thanks
    Sam

    LOGMiner --> Using LogMiner to Analyze Redo Log Files
    AUDIT --> Configuring and Administering Auditing

  • How to find out who's texting you from an iCloud email address?

    how to find out who's texting you from an icloud email address?

    OK after a bit of research I found a way to achieve this.
    I simply looked up the email address in ADUC, then did a search in SP with the display name. I could locate the list and manually confirm it was configured with the incoming email address I was looking for.
    I also found the below script on Stackoverflow, but got "The 'using' keyword is not supported in this version of the language." when I tried to run it. Any idea how to fix that? I'd like to have a script to link a library to an email address istead of the
    manual approach described above.
    http://stackoverflow.com/questions/4974110/sharepoint-how-do-i-find-a-mail-enabled-list-if-i-only-have-the-email
    $SiteCollection = ""
    $EmailAddress = "" # only the part before the @
    # Load SharePoint module if not done yet
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {Add-PSSnapin Microsoft.SharePoint.PowerShell;}
    cls
    using System;
    using Microsoft.SharePoint;
    namespace FindListByEmail
    class Program
    {a
    static void Main(string[] args)
    string siteUrl = $SiteCollection;
    string email = $EmailAddress;
    using (SPSite site = new SPSite(siteUrl))
    foreach (SPWeb web in site.AllWebs)
    try
    foreach (SPList list in web.Lists)
    if (list.CanReceiveEmail)
    if (list.EmailAlias != null && list.EmailAlias.Equals(email, StringComparison.InvariantCultureIgnoreCase))
    Console.WriteLine("The email belongs to list {0} in web {1}", list.Title, web.Url);
    Console.ReadLine();
    return;
    finally
    if (web != null)
    web.Dispose();

  • How can i find out how old my macbook pro is?

    I want to find out how old my macbook is without having to take it into a store, is it possible. If so how do i do it

    sig,
    Stupid mistake on my part - I didn't realize that you simply had to enter your serial number in the 'search' bar - I did and it gives far more info than any other sn website I've visted.
    So I bookmarked it.
    Thanks,
    Clinton

  • Can any one let me know how to  find out current internet explorer version

    Can any one let me know how to find out current internet explorer version

    Don;t use annoyed repeated words. Try to explain exactly what is your problem.
    <script LANGUAGE="JavaScript">
    document.write("Your browser Name: <B>" + navigator.appName + "</B>.<br>")
    //Detect IE Version Only
    if (navigator.appVersion.indexOf("MSIE")!=-1){
    var temp=navigator.appVersion.split("MSIE")
    var version=parseFloat(temp[1])
    document.write(" Your Browser version: <B>" + version + "</B>.")
    </script>

  • How to find out current archtecture

    I have installed Oracle Database Express Edition 11g Release 2. APEX 4.0 has been installed automatically. (I didn't configure any servers, just clicked 'next')
    Now I have to upgrade APEX to 4.1 , but I must know, what should I configure - Oracle Application Express Listener, the Embedded PL/SQL Gateway, or Oracle HTTP Server?
    So, how to find out current archtecture of APEX 4.0 ?
    Thank you,
    Kseniya.

    Kseniya wrote:
    I have installed Oracle Database Express Edition 11g Release 2. APEX 4.0 has been installed automatically. (I didn't configure any servers, just clicked 'next')In that case, it should be Embedded PL/SQL Gateway. Is there a port number in the URL? What is it?

  • I cannot upload to youtube from within the iMovie or the files exported to the finder. Any ideas?

    Upgraded to Mavericks and iMovie 10 on a mid 2012 MBP. I cannot upload to youtube from within the app or the files exported to the finder. Any ideas?

    Upgraded to Mavericks and iMovie 10 on a mid 2012 MBP. I cannot upload to youtube from within the app or the files exported to the finder. Any ideas?

  • I was organizing my photos into albums. then deleting them from my Camera roll. Then I went into MY Photo Stream and started deleting the pics I had moved to albums;Come to find out I deleted all pic from everywhere!!  Would the iCloud still have them sav

    I was organizing my photos into albums. then deleting them from my Camera roll. Then I went into MY Photo Stream and started deleting the pics I had moved to albums;Come to find out I deleted all pic from everywhere!!  Would the iCloud still have them saved

    First of all, you should always save you photos on computer like any other digital camera.
    Backup on iCloud or iTunes only backup your Camera Roll. The other photos should be already on the computer.
    Note: Photos are not saved in iTunes, it's only a conduit between your iPhone and your photo managing software on computer.
    What computer do you have?

  • Here's a dumb ? I'm trying to find out how I can print from my ipad. I read about air streaming printers. so is a wireless printer considered an air streaming printer. i have 1 pc, my mac

    here's a dumb ? I'm trying to find out how I can print from my ipad. I read about air streaming printers. so is a wireless printer considered an air streaming printer. i have 1 pc, my mac

    If you already have a printer, you can probable use a program like, printopia to let your mac share your printer with the iOS device like your iPad. The catch being your computer has to be on, and not asleep, for the printer to work with your iPad.
    If you need a printer that is airprint ready, you can find a list on AirPrint, wireless printing straight from your iPad. Check out the bottom of the page where it says works with airprint enabled printers. There are even links on the page so you can buy the printers right from Apple's website.

  • I cannot find out how to upload pictures from computer to ipad on updated version of itunes.

    I cannot find out how to upload pictures from computer to ipad on updated itunes.

    I've gone through this one. The new version of itunes I have doesn't list the devices on the left side but across the top and there is no place about photos. Also noticed If trying to move docunments from numbers it's no longer at the bottom of the app page as in the past and I have to email docs between computer and ipad.

  • Any way to know where a clip came from within the source clip?

    Using Premiere Pro CS4, Version 4.2.1, on an i7 based PC.
    I would like to be able to see where a clip on the timeline came from within the clip in the source monitor. Where ever there is information about the clip on the timeline, it only seems to tell me it's 'Start', 'End' and 'Duration' in relation to the current Sequence, but nothing relating to the 'In' or the 'Out' points within the source clip.
    Is it possible to read this somewhere, rather than having to replay the clip in the source monitor to discover the in and out points? It tends to be tedious doing this too often.
    Thanks in advance, hopefully.
    Peter.

    Awesome sauce Shooter 
    That is exactly what I wanted to know.
    Much appreciated!!!
    Peter

Maybe you are looking for