Aggressive Heap and garbage collection in 1.4.2

We are trying to monitor the memory usage and the garbage collection for one of our application servers. We are using JDK 1.4.2 b-19 on solaris 8. The machine has 4 900 Mhz CPUs and 8GB ram. The VM options are:
-server -XX:+AggressiveHeap -Xms3512m -Xmx3512m -verbose:gc
-XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCTimestamps.The first full GC kicks in when the old generation gets full which is understandable. After that however, the full gc kicks in much more frequently and even the gc pauses are fairly long. Below are some of the output from gc.
For the first GC the old generation was almost full.
PSYoungGen total 1379840K, used 1324288K
PSOldGen total 2123648K, used 2103378K
For the second GC, young generation is 25MB out of 1300MB and old generation is 1100MB out of 2100MB. Still the full gc kicked in and took 23 secs.
PSYoungGen total 1356608K, used 25856K
PSOldGen total 2123648K, used 1169626K
I understand that the adaptive sizing is kicking in (by default) but it should make life better not worse. If the full GC could wait till the old generation gets full again, I will get lesser number of full gc pauses and few and far in between.
Any idea as to what I can do?
thanks
vinay
{Heap before GC invocations=108:
Heap
PSYoungGen      total 1379840K, used 1324288K [0x1a000000, 0x73e20000, 0x73e20000)
  eden space 228096K, 100% used [0x1a000000,0x27ec0000,0x27ec0000)
  from space 1151744K, 95% used [0x27ec0000,0x6ad40000,0x6e380000)
  to   space 92800K, 0% used [0x6e380000,0x6e380000,0x73e20000)
PSOldGen        total 2123648K, used 2103378K [0x73e20000, 0xf5800000, 0xf5800000)
  object space 2123648K, 99% used [0x73e20000,0xf4434af8,0xf5800000)
PSPermGen       total 31872K, used 31768K [0xf5800000, 0xf7720000, 0xf9800000)
  object space 31872K, 99% used [0xf5800000,0xf7706200,0xf7720000)
2842.142: [Full GC 3427666K->1083494K(3503488K), 26.6495189 secs]
Heap after GC invocations=108:
Heap
PSYoungGen      total 1379840K, used 0K [0x1a000000, 0x73e20000, 0x73e20000)
  eden space 1287040K, 0% used [0x1a000000,0x1a000000,0x688e0000)
  from space 92800K, 0% used [0x6e380000,0x6e380000,0x73e20000)
  to   space 92800K, 0% used [0x688e0000,0x688e0000,0x6e380000)
PSOldGen        total 2123648K, used 1083494K [0x73e20000, 0xf5800000, 0xf5800000)
  object space 2123648K, 51% used [0x73e20000,0xb6039978,0xf5800000)
PSPermGen       total 63744K, used 31768K [0xf5800000, 0xf9640000, 0xf9800000)
  object space 63744K, 49% used [0xf5800000,0xf7706200,0xf9640000)
{Heap before GC invocations=114:
Heap
PSYoungGen      total 1356608K, used 25856K [0x1a000000, 0x73e20000, 0x73e20000)
  eden space 1240576K, 0% used [0x1a000000,0x1a000000,0x65b80000)
  from space 116032K, 22% used [0x6ccd0000,0x6e610000,0x73e20000)
  to   space 116032K, 0% used [0x65b80000,0x65b80000,0x6ccd0000)
PSOldGen        total 2123648K, used 1169626K [0x73e20000, 0xf5800000, 0xf5800000)
  object space 2123648K, 55% used [0x73e20000,0xbb456858,0xf5800000)
PSPermGen       total 65536K, used 31773K [0xf5800000, 0xf9800000, 0xf9800000)
  object space 65536K, 48% used [0xf5800000,0xf7707578,0xf9800000)
3153.022: [Full GC 1195482K->1149586K(3482688K), 23.3155823 secs]
Heap after GC invocations=114:
Heap
PSYoungGen      total 1359040K, used 0K [0x1a000000, 0x73e20000, 0x73e20000)
  eden space 1245440K, 0% used [0x1a000000,0x1a000000,0x66040000)
  from space 113600K, 0% used [0x6cf30000,0x6cf30000,0x73e20000)
  to   space 113600K, 0% used [0x66040000,0x66040000,0x6cf30000)
PSOldGen        total 2123648K, used 1149586K [0x73e20000, 0xf5800000, 0xf5800000)
  object space 2123648K, 54% used [0x73e20000,0xba0c4830,0xf5800000)
PSPermGen       total 65536K, used 31773K [0xf5800000, 0xf9800000, 0xf9800000)
  object space 65536K, 48% used [0xf5800000,0xf7707578,0xf9800000)
}

We also had similar issues...If you are using RMI it might cause Full GC. This is the snippet from http://java.sun.com/docs/hotspot/gc/
<snip>
Garbage can't be collected in these distributed applications without occasional local collection, so RMI forces periodic full collection. The frequency of these collections can be controlled with properties. For example,
java -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
</snip>
By default this is 1 min. So try changing this and try it out.

Similar Messages

  • SystemManager and Garbage Collection

    Hi everyone, I have a question regarding the SystemManager and Garbage Collection. I have and application that loads in its assets via a swc created in Flash. In that swc I have different MovieClips that act as the different screens of my application each one being tied to its own custom class. For example one MovieClip is a login screen another is the main menu etc. These screens contain components, text fields and animations. The problem that I am having is when I move from one screen to the other the garbage collector is not cleaning up everything. There are still references to the MovieClips that have animations for example. So even though I remove the screen via removeChild and set the variable reference to that object to null it is not releasing the MovieClips. When I pull it up in the profiler it shows me that SystemManager is holding references to them. Also if I debug the applicaion and look inside the instance of the MovieClip I can see that the private property "listeners" has values, but I am not adding listeners. It appears that the SystemManager is adding listeners. Does anyone know how I can clear these listeners or force the SystemManager to release these items. Any ideas or help would be greatly appreciated. I am fairly new to dealing with memory management and garbage collection in Flex. I am using Flash CS4 to create the swc and Flash Builder 4 Beta with the 3.4 framework and Flash Player 10 to create the app. If you need me to clarify any of this please let me know. Again any help or ideas on where to go from here would be great!

    This chain says that the focusManager is referencing UserMenu.  Is there a default button or focusable objects in UserMenu and references from UserMenu to the objects in question?
    BTW, the CS4 fl.managers.FocusManager and any fl.. classes are incompatible with Flex, so make sure you're not using them in your MovieClips.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Remove / unload external swf file(s) from the main flash file and load a new swf file and garbage collection from memory.

    I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
    This is the error message(s) I am receiving: "TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/Down3()"
    import nl.demonsters.debugger.MonsterDebugger;
    var d:MonsterDebugger=new MonsterDebugger(this);
    stage.scaleMode=StageScaleMode.NO_SCALE;
    stage.align=StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);
    // loader is the loader for portfolio page swf
    var loader:Loader;
    var loader2:Loader;
    var loader3:Loader;
    var loader1:Loader;
    //  resize content
    function resizeHandler(event:Event):void {
        // resizes portfolio page to center
    loader.x = (stage.stageWidth - loader.width) * .5;
    loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    /*loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;*/
    addEventListener(Event.ENTER_FRAME, onEnterFrame,false, 0, true);
    function onEnterFrame(ev:Event):void {
    var requesterb:URLRequest=new URLRequest("carouselLoader.swf");
    loader = null;
    loader = new Loader();
    loader.name ="carousel1"
    //adds gallery.swf to stage at begining of movie
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requesterb);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    // stop gallery.swf from duplication over and over again on enter frame
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent):void {
    // re adds listener for contact.swf and about.swf
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
    var requester:URLRequest=new URLRequest("carouselLoader.swf");
        loader = null;
    loader = new Loader();
    loader.name ="carousel"
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    removeChild( getChildByName("about") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of gallery.swf
    MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    function Down1(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    var requester:URLRequest=new URLRequest("contactLoader.swf");
    loader2 = null;
    loader2 = new Loader();
    loader2.name ="contact"
    loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader2.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader2);
    loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    function Down3(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    var requester:URLRequest=new URLRequest("aboutLoader.swf");
    loader3 = null;
    loader3 = new Loader();
    loader3.name ="about"
    loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader3.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader3);
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    removeChild( getChildByName("carousel") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
    stop();

    Andrei1,
    Thank you for the helpful advice. I made the changes as you suggested but I am receiving a #1009 error message even though my site is working the way I wan it to work. I would still like to fix the errors so that my site runs and error free. This is the error I am receiving:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    I'm sure this is not the best method to unload loaders and I am guessing this is why I am receiving the following error message.
         loader.unload();
         loader2.unload();
         loader3.unload();
    I also tried creating a function to unload the loader but received the same error message and my portfolio swf was not showing at all.
         function killLoad():void{
         try { loader.close(); loader2.close; loader3.close;} catch (e:*) {}
         loader.unload(); loader2.unload(); loader3.unload();
    I have a question regarding suggestion you made to set Mouse Event to "null". What does this do setting the MouseEvent do exactly?  Also, since I've set the MouseEvent to null do I also have to set the loader to null? e.g.
    ---- Here is my updated code ----
    // variable for external loaders
    var loader:Loader;
    var loader1:Loader;
    var loader2:Loader;
    var loader3:Loader;
    // makes borders resize with browser size
    function resizeHandler(event:Event):void {
    // resizes portfolio page to center
         loader.x = (stage.stageWidth - loader.width) * .5;
         loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
    //adds gallery.swf to stage at begining of moviie
         Down();
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent = null):void {
    // re adds listener for contact.swf and about.swf
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
         var requester:URLRequest=new URLRequest("carouselLoader.swf");
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader.load(requester);
         } catch (error:SecurityError) {
         trace(error);
         this.addChild(loader);
         loader.x = (stage.stageWidth - 739) * .5;
         loader.y = (stage.stageHeight - 500) * .5;
    // sure this is not the best way to do this - but it is unload external swfs
         loader.unload();
         loader2.unload();
         loader3.unload();
    // remove eventlistner and prevents duplication of gallery.swf
         MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         function Down1(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         var requester:URLRequest=new URLRequest("contactLoader.swf");
         loader2 = null;
         loader2 = new Loader();
         loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);    
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader2.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader2);
         loader2.x = (stage.stageWidth - 658.65) * .5;
         loader2.y = (stage.stageHeight - 551.45) * .5;
    loader.unload();
    loader2.unload();
    loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         function Down3(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         var requester:URLRequest=new URLRequest("aboutLoader.swf");
         loader3 = null;
         loader3 = new Loader();
         loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader3.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader3);
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
         loader.unload();
         loader2.unload();
         loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
         stop();

  • SAX XML Parsing and Garbage Collection

    I'm writing an XML parser that is running extremely slow while parsing large documents, I believe due to garbage collection. The implementation just overloads the DefaultHandler and hands that to a SAX Parser. This works fine on 2500 line XML document, taking on average a second or two, but becomes untennable when the document size is increased by a factor of 10 (often taking 5+ minutes).
    I come from a C++ background and haven't dealt with automatic garbage collection at an expert level, so I'd appreciate any help. Below is a snapshot garbage collection done while a 25000 line document being parsed. It looks to me as the young objects are staying small, but older objects are going between 13M and 90M and back again. Is that what's happening? Can anyone give me leads as to what to look? Thanks in advance.
    [GC [DefNew: 6234K->0K(7168K), 0.0057359 secs] 15517K->13022K(101696K), 0.0057907 secs]
    [GC [DefNew: 6235K->0K(7168K), 0.0057748 secs] 19257K->16762K(101696K), 0.0060357 secs]
    [GC [DefNew: 6235K->0K(7168K), 0.0023584 secs] 22997K->18009K(101696K), 0.0024123 secs]
    [GC [DefNew: 6236K->0K(7168K), 0.0040785 secs] 24245K->20502K(101696K), 0.0041315 secs]
    [GC [DefNew: 4990K->0K(7168K), 0.0041025 secs] 25492K->22996K(101696K), 0.0041544 secs]
    [GC [DefNew: 4990K->0K(7168K), 0.0041486 secs] 27987K->25491K(101696K), 0.0042022 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0040782 secs] 30481K->27985K(101696K), 0.0041299 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0040935 secs] 32976K->30479K(101696K), 0.0046294 secs]
    [GC [DefNew: 4991K->0K(7168K), 0.0041433 secs] 35471K->32974K(101696K), 0.0041958 secs]
    [GC [DefNew: 4992K->0K(7168K), 0.0041114 secs] 37966K->35469K(101696K), 0.0041634 secs]
    [GC [DefNew: 6240K->0K(7168K), 0.0024190 secs] 41709K->36717K(101696K), 0.0024729 secs]
    [GC [DefNew: 6240K->0K(7168K), 0.0041377 secs] 42957K->39212K(101696K), 0.0041972 secs]
    [GC [DefNew: 4993K->0K(7168K), 0.0041234 secs] 44205K->41707K(101696K), 0.0041762 secs]
    [GC [DefNew: 4993K->0K(7168K), 0.0042827 secs] 46701K->44203K(101696K), 0.0046299 secs]
    [GC [DefNew: 4994K->0K(7168K), 0.0043195 secs] 49197K->46699K(101696K), 0.0043751 secs]
    [GC [DefNew: 4994K->0K(7168K), 0.0042740 secs] 51693K->49195K(101696K), 0.0043293 secs]
    [GC [DefNew: 4995K->0K(7168K), 0.0042044 secs] 54190K->51692K(101696K), 0.0042575 secs]
    [GC [DefNew: 4995K->0K(7168K), 0.0042237 secs] 56686K->54188K(101696K), 0.0042762 secs]
    [GC [DefNew: 4996K->1K(7168K), 0.0040036 secs] 59183K->56685K(101696K), 0.0040550 secs]
    [GC [DefNew: 4996K->1K(7168K), 0.0042095 secs] 61680K->59182K(101696K), 0.0045992 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042193 secs] 64178K->61679K(101696K), 0.0042715 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042301 secs] 66675K->64176K(101696K), 0.0042818 secs]
    [GC [DefNew: 4997K->1K(7168K), 0.0042726 secs] 69173K->66674K(101696K), 0.0043251 secs]
    [GC [DefNew: 4998K->1K(7168K), 0.0042564 secs] 71671K->69172K(101696K), 0.0043084 secs]
    [GC [DefNew: 4998K->1K(7168K), 0.0040301 secs] 74169K->71669K(101696K), 0.0040812 secs]
    [GC [DefNew: 4999K->1K(7168K), 0.0042656 secs] 76668K->74168K(101696K), 0.0047255 secs]
    [GC [DefNew: 4999K->1K(7168K), 0.0043100 secs] 79166K->76666K(101696K), 0.0043737 secs]
    [GC [DefNew: 5000K->1K(7168K), 0.0043492 secs] 81665K->79165K(101696K), 0.0044034 secs]
    [GC [DefNew: 5000K->1K(7168K), 0.0043165 secs] 84164K->81664K(101696K), 0.0043693 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0044196 secs] 86663K->84163K(101696K), 0.0044735 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0044439 secs] 89163K->86662K(101696K), 0.0044967 secs]
    [GC [DefNew: 5001K->1K(7168K), 0.0043983 secs] 91662K->89161K(101696K), 0.0045313 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0043422 secs] 94162K->91661K(101696K), 0.0043944 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0044223 secs] 96662K->94160K(101696K), 0.0044757 secs]
    [GC [DefNew: 5002K->1K(7168K), 0.0048545 secs][Tenured: 96659K->9291K(97032K), 0.0863445 secs] 99162K->9291K(104200K), 0.0913954 secs]

    I don't think I'm creating megabytes of data, not using hashes or other expandable arrays. I've copied and pasted some code from my overriding of a DefaultHandler to give better definition to the problem.
    I'm working with TPTP right now as a profiler. Are there any others you'd recommend?
         public void startElement(String uri, String localname, String qName, Attributes attribs)
         throws SAXException
              if(qName.equals("Line"))
                   attributes = attribs;
              else if(qName.equals("Note"))
                   attributes = attribs;
              else if(qName.equals("Selection"))
                   String idValue = attribs.getValue("id");
                   String oValue = attribs.getValue("off");
                   String lValue = attribs.getValue("len");
                   if(idValue != null && oValue != null && lValue != null)
                        if(isImport)
                             issueSelectionContainer.addUnloadedSelection(Integer.parseInt(idValue), Integer.parseInt(oValue), Integer.parseInt(lValue));
                        else
                             issueSelectionContainer.addSelection(Integer.parseInt(idValue), Integer.parseInt(oValue), Integer.parseInt(lValue));
              else if(qName.equals("Issue"))
                   attributes = attribs;
              if(qName.equals("IsFinal"))
                   isFinal = true;
         public void endElement(String uri, String localname, String qName)
         throws SAXException
              if(textElement.length() > 0)
                   if(qName.equals("Line"))
                        String qmValue = attributes.getValue("qm");
                        String lnValue = attributes.getValue("ln");
                        String pgValue = attributes.getValue("pg");
                        boolean qm = (qmValue != null && qmValue.equalsIgnoreCase("true"));
                        short ln = (lnValue != null) ? Short.parseShort(lnValue) : 0;
                        short pg;
                        if(pgValue != null)
                             pg = Short.parseShort(pgValue);
                             page = pg;
                        else
                             pg = page;
                        lineContainer.addLine(textElement + '\n', ln, pg, qm, null);
                   else if(qName.equals("Note"))
                        String lnValue = attributes.getValue("line");
                        if(lnValue != null)
                             int line = Integer.parseInt(lnValue);
                             try
                                  lineContainer.getLine(line).setNote(textElement);
                             catch (IndexOutOfBoundsException e)
                                  throw new SAXException("XML/Data mismatch.  Note on line \"" + line + "\" out of \"" + lineContainer.lineCount() + "\" lines", e);
                   else if(qName.equals("Issue") && isImport)
                        String idValue = attributes.getValue("id");
                        String cValue = attributes.getValue("color");
                        if(idValue != null && cValue != null)
                             issueSelectionContainer.addUnloadedIssueSelection(Integer.parseInt(idValue), new Color(Integer.parseInt(cValue)), textElement);
                   else if(qName.equals("Name"))
                        name = textElement;
                   else if(qName.equals("Description"))
                        description = textElement;
                   else if(qName.equals("CreationDate"))
                        date = getCalendarFromString(textElement);
                   textElement = "";
                   attributes = null;
         public void characters(char buf[], int offset, int len)
        throws SAXException
              textElement = new String(buf, offset, len);
        }

  • A question about JNI references, persistence, and garbage collection

    I am writing a library to allow our Java developers to access C functions in our product. I want people on the Java side to be able to instantiate instances of a new object (on the C side), say "Map", and I want those objects to persist until they are destroyed on the Java side. I am thinking of creating a wrapper for the native methods, which stores an identifier for the instance of an object. When the C object is accessed, the identifier is passed to the C code which looks up the correct object in a table. I understand that if I use the NewGlobalReference call in JNI I can get objects to persist.
    When it is time for garbage collection I plan to override finalize() to call the C code and tell it to remove the Global Reference.
    Here's what I have in mind
    public class JMap() {
         private static int id;
         static {
              System.loadLibrary("libMap");
              /*Call C method which instantiates object and creates a GlobalReference
              which is stored in table. Returns ID for reference*/
              id = _init();
         public void setSize(int x, int y) {
              _setSize(id, x, y);
         public void finalize() {
              _finalize(id);
              super.finalize();
         private native int _init();
         /*calls DeleteGlobalReference for the reference matching this id*/
         private native void _finalize(int id);
         private native void _setSize(int id, int x, int y);
    }Is this the right thing to do? Have I understood the way JNI works with regard to GlobalReferences?
    Any comments, tips or pointers would be appreciated :)

    This probably should have been posted in the Native Methods sub-forum, I have reposted there:
    http://forum.java.sun.com/thread.jspa?threadID=657667
    Mods please delete this post :)

  • Runtime.getRuntime().exec() and Garbage Collection

    I am programming a piece of software in both Java and C that has some strict real time requirements. Garbage collection, which pauses all threads in Java, sometimes causes loss of incoming data. In order to get around this, I am thinking to start another process using Runtime.getRuntime().exec("c_program") and using interprocess controls (in a UNIX environment) to retrieve data from the new process.
    My only worry is that the Process created by the above call would be a child process of whatever JVM thread created it, (as far as I understand, the JVM implementation in Unix uses multiple processes) and would also be paused when garbage collection occurs. Does anyone know the implementation of the exec functionality and the JVM well enough to say that this will or will not happen?
    Thanks in advance,
    Benjamin

    You're going to create a whole new process? I don't
    know what a "child process" means, but Runtime.exec()
    gets the operating system to produce an entirely new
    process, outside the JVM. However if it produces
    output on stdout or stderr, you're going to have
    threads in your JVM that read that output, otherwise
    that process will hang.
    Why is your idea better than just calling the C
    program via JNI?Thank you both for your replies. My plan was to create a whole new process, yes. In UNIX, a process C is created by another process P using fork() or the exec() family. Process P is then the parent of process C, and process C is the child of Process P. P has an amount of control over C since it can send various signals to pause, kill, etc to C.
    My concern was that the JVM implementation would use these signals to implement the pause of all threads before garbage collecting. If it did, it may also pause the Process that it spawned from the Runtime.exec() call. Pausing my C program in this manner would cause the loss of data I was trying to avoid in the first place.
    My plan for the new process was not to produce anything on stdout or stderr, but to pass data back to the JVM using ipc (interprocess communication) resources of UNIX. I would have to use the JNI to access these resources.
    The whole reason for wanting to do this is to avoid the pause during garbage collection that all Java Threads experience. If I were just to call the C program through the JNI with a normal Java Thread as I think you were suggesting, this Java Thread would still be paused during garbage collection.
    To the second reply about RTSJ, I had heard about this but couldn't find info about it! Thanks for the link. I'm checking it out at the moment. The java runtime must be considerably different for the specifications I see that they guarantee.
    Again, thanks for the replies,
    Benjamin

  • Memory handling and garbage collection?

    Sorry, these are the correct snippets of code, of course:
    public class Test {
         public static void main(String[] args) {
              byte[] b = new byte[10000000];
              b = null;
              while(true) {}
    public class Test {
         public static void main(String[] args) {
              new Test();
         public Test()
              byte[] b = new byte[10000000];
              b = null;
              zzz();
         public synchronized void zzz()
              try
                   wait();
              catch(Throwable t) {}

    Oh god this is all messed up... Original message then:
    Hi all!
    I'm just interested in the way that Java handles garbage and frees memory, as I have seen some problems with this in the chat server I'm building. I was under the impression that you could remove a reference to something and the memory allocated by it would automatically free up.
    I wrote a stupid little test program that allocates a 10MB byte array and then immediately removes the reference to it. Using the Windows Task Manager I just compared the memory usage when allocating the huge array, to the usage when not. When using the array my program eats about 15MB of memory, while the amount when not using the array is about 5MB. So it's obvious that no memory at all is freed when I remove the reference to that array.
    public class Test {
         public static void main(String[] args) {
              byte[] b = new byte[10000000];
              b = null;
              while(true) {}
    }Ok so perhaps the Garbage Collector doesn't operate while in an endless loop. A little change to let the program get stuck in a wait() instead:
    public class Test {
         public static void main(String[] args) {
              new Test();
         public Test() {
              byte[] b = new byte[10000000];
              b = null;
              zzz();
         public synchronized void zzz() {
              try {
                   wait();
              catch(Exception e) {}
    }Unfortunately, the result is the same. Program eats 10MB of memory too much, and it wouldn't free up in the few minutes I waited anyway.
    Anyone at all have thoughts on this?
    Thanks

  • Manual garbage collection

    Im running a huge combinatorial generation algorithm and i'm starting to run into memory allocation errors on larger problem instances. I am using the -Xmx256m run time option on the JVM to give it more memory but im generating huge masses off stuff here.
    The question I have is, if I know an object isnt going to be used again is it worth destroying it in memory yourself; i assume if you have some undesired object you can do something like this;
    myObject = null;
    and then call the garbage collector to free up the memory..firstly will this work, secondly what is there performance tradeoff for calling the garbage collector more often and lastly is the garbage collector allready efficient enough that doing things like this is probably not worth it.
    Regards,
    Dave

    Setting references to null MAY help get immediate relief, but its not guarunteed to help. Same with the System.gc() call.
    Doing both those thing will not enable the system to operate with less memory than before, as variables that are out of scope will be discovered during garbage collection, and garbage collection WILL run when the heap is fully utilized.
    Doing the above may make the GC pause lower at the expense of worse performance.
    Instead of doing the above, I'd recommand using the Incremental GC by specifying -Xincgc on the command line. This will run GC more often in the background, leading to shorter GC pauses, but about 10% performance hit in general.
    If OTOH you are running into OutOfMemoryErrors and don't think you should be, you probably have a memory leak. Most likely you are allocating objects and storing them somewhere then forgetting about them. For example, if you stick an object in a HashMap, and then forget about it, that object will not be GC'd, unless the HashMap can be GC'd.

  • Static class garbage collection

    Can garbage collector can garbage collect static classes ?.
    My doubt is that when you access a static class , that class is loaded through its class loader ( when first time that class is referenced ).
    So when did the garbage collector collects this static class ( assume that static class no longer referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a particular class ( Assume that i m implementing a singleton for my java runtime)
    thanks and regards
    Renjith.

    Can garbage collector can garbage collect static classes ?. Static classes are nothing special in terms of class loading - they are only different in visibility for linking.
    Perhaps you mean static members of classes?
    My doubt is that when you access a static class ,
    that class is loaded through its class loader ( when
    first time that class is referenced ). Classes are always loaded through classloaders. Objects of those classes are allocated from the heap, and the object instances refer to the class object.
    Objects (either instances, or classes themselves) are garbage collected when they are no longer live (i.e. no live object refers to them). (This is a somewhat recursive definition, and sometimes, you can have cyclic dependencies that make garbage collection tricky, but the GC, while it has to be conservative for correctness, usually gets it right).
    So for a static member to be garbage-collected, the class has to be garbage-collected first. The class cannot be GC'ed until all references to it go away (this includes all dynamically allocated objects of that type, and the class loader that loaded that class).
    And yes, class loaders can go away, but only if they are created by your program. The system class loader (which is the default classloader you get if you don't create any class loaders of your own) never goes away, so any class loaded from CLASSPATH will never be unloaded.
    (As an example, servlet containers - e.g. Tomcat, Weblogic, etc.) allocate one or more classloaders for each webapp. When the webapp is un-deployed, the classloaders are "orphaned", and they, and any classes loaded by them (from the WEB-INF/lib and WEB-INF/classes directories) are unloaded and garbage-collected. (After all the dynamic objects of those classes are GC'ed, of course).
    >
    So when did the garbage collector collects this
    static class ( assume that static class no longer
    referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a
    particular class ( Assume that i m implementing a
    singleton for my java runtime)
    thanks and regards
    Renjith.

  • WLS not garbage collecting enough?

    WLS 5.1 SP5
    SunOS 5.6 (2.6)
    JDK 1.2.2_005a (with the JVMARGS directive set as per BEA's docs. The
    JVMARGS directive solved the SIGBUS 10 for us when requesting the
    AdminMain servlet)
    We tried some stress testing of our web app by running about 100 to 200
    virtual clients requesting the same URL (servlet that forwards to a
    JSP). These virtual clients are actually Java threads running
    simultaneously.
    After each test, we notice that, via WL console, the heap usage of WL
    increased. However, after leaving WL server by itself (no HTTP requests
    coming to it) for a long time (say 30 minutes to 1 hour), we noticed
    that the heap usage has not gone down, except for about 1%. As soon as
    we explicitly tell WLS to garbage collect via the WL console, then the
    heap usage goes down ... sometimes even as low as just 10% when we tell
    it to gc again just after a gc a few seconds earlier.
    Is this proper behaviour by WLS? ... or does this have something to do
    with the JVMARGS directive? Why doesn't it gc even after a long time?
    Thanks in advance,
    John Salvo
    Homepage: http://homepages.tig.com.au/~jmsalvo/

    There are a number of problems with memory usage and garbage collection. Going to WLS 5.1 will fix
    some of them. You should also consider having your application call System.runFinalization(); and
    System.gc() from time to time.
    Mike
    "Jim Zhou" <[email protected]> wrote:
    I see the same behavior in my stress test/pre-production run. I think it's
    normal behavior. The GC will kick in when the heap size gets 100%, you might
    see a pause in your WLS because all threads will stop for the GC ( you
    should see CPU really busy when GC is in ). JDK 1.2 should have better GC
    algorithm than JDK 1.1. Usually for people still using JDK1.1.x, tuning the
    heap size for tolerable GC pause is a pain., the tuning guide want you to
    run multiple WLS instances in a box to stagger the effects of GC pause. If
    you use JDK 1.2, you probably set your heap size comparable to your box's
    memory.
    In one of my stress test, I set heap size to 256m, I see on my console the
    heap gets full every 30 seconds, and it take 1 or 2 seconds to GC. But if
    your heap is 2G, it might take longer.
    WLS 4.51 SP11
    Solaris 2.6
    JDK 1.2.2_06.
    Regards,
    Jim Zhou.
    Jesus M. Salvo Jr. <[email protected]> wrote in message
    news:[email protected]...
    WLS 5.1 SP5
    SunOS 5.6 (2.6)
    JDK 1.2.2_005a (with the JVMARGS directive set as per BEA's docs. The
    JVMARGS directive solved the SIGBUS 10 for us when requesting the
    AdminMain servlet)
    We tried some stress testing of our web app by running about 100 to 200
    virtual clients requesting the same URL (servlet that forwards to a
    JSP). These virtual clients are actually Java threads running
    simultaneously.
    After each test, we notice that, via WL console, the heap usage of WL
    increased. However, after leaving WL server by itself (no HTTP requests
    coming to it) for a long time (say 30 minutes to 1 hour), we noticed
    that the heap usage has not gone down, except for about 1%. As soon as
    we explicitly tell WLS to garbage collect via the WL console, then the
    heap usage goes down ... sometimes even as low as just 10% when we tell
    it to gc again just after a gc a few seconds earlier.
    Is this proper behaviour by WLS? ... or does this have something to do
    with the JVMARGS directive? Why doesn't it gc even after a long time?
    Thanks in advance,
    John Salvo
    Homepage: http://homepages.tig.com.au/~jmsalvo/

  • Full garbage collection issue, not releasing/flagging memory

    I have the following problem running on a multi-cpu windows server with Java 1.4.2_05 using WebLogic 8.1:
    During a lifecyle of the web application (under load, but not to heavy) memory usage seems ok and garbage collection is called regularly. Suddenly, the used heap starts to rize very fast and after a while, even a full garbage collection cylce, does not release any memory anymore.
    I am sure that, from our coding, we release memory ok, and normally we should only use about 5 to 10 mb for each user max (with0 normal defnew garbage collections).
    I tried changing the garbage collection parameters, but this does not solve the problem. Best scenario was with the concurrent collector and I got this output at +/- the end:
    [GC 100202K->93511K(115628K), 0.0091472 secs]
    [GC 148480K->139612K(163808K), 0.0225914 secs]
    [Full GC[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor289]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor290]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor273]
    153750K->133006K(164064K), 1.2434402 secs]
    [GC 148939K->137948K(203264K), 0.0223085 secs]
    [GC 188789K->177116K(203264K), 0.0180729 secs]
    [Full GC[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor312]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor322]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor309]
    189788K->170264K(203264K), 1.1851945 secs]
    [Full GC 203228K->203227K(203264K), 1.2876122 secs]
    [Full GC 203263K->203233K(203264K), 1.3354548 secs]
    [Full GC 203263K->203258K(203264K), 1.2873518 secs]
    <Jan 17, 2007 9:40:40 AM EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=33114655,name=console,context-path=/console)] Root cause of ServletException.
    java.lang.OutOfMemoryError
    >
    [Full GC 203263K->203233K(203264K), 1.2814516 secs]
    [Full GC 203233K->203231K(203264K), 1.6029044 secs]
    [Full GC 203263K->203242K(203264K), 1.3081352 secs]
    <Jan 17, 2007 9:41:51 AM EST> <Emergency> <WebLogicServer> <BEA-000210> <The WebLogic Server is no longer listening for connections.>
    [Full GC 203263K->203247K(203264K), 1.3161194 secs]
    [Full GC 203263K->203249K(203264K), 1.2954988 secs]
    [Full GC 203263K->203247K(203264K), 1.6423404 secs]
    <Jan 17, 2007 9:41:57 AM EST> <Alert> <WebLogicServer> <BEA-000218> <Server shutdown has been requested by <WLS Kernel>>
    [Full GC 203263K->203250K(203264K), 1.3161025 secs]
    Another strange item is: I maximized the amount of memory it uses to 512m with the Xmx parameter, I am almost sure that that one is used, but it never gets higher than 203M? Does anyone know why this is?
    Another strange item: the monitoring in the weblogic code indicates 32MB of usage (relative memory usage seems to be ok, but the quanity indication is just plain wrong) with 15 threads running.
    This problem does not exist when using JBoss 4.0.2 or 4.0.3 (standard j2ee settings).
    If anyone has an idea or can help me, I would appreciate it very very much. :)

    Hi ,
    Is this issue resolved ?
    we are facing same problem.
    1. We have checked the CPU and memory utilization everything is normal
    2. GC logs showing FULL GC calls continuously
    3. After restart the resin server system is working normally.
    Environment detail
    Resin ./resin-pro-3.0.18 on suse Linux
    Java JDK1.4.2_08
    Please suggest

  • Getting memory dump without garbage collection

    Hi all.
    Does anyone know of a way to get a memory dump from the Sun JVM (version 1.5.0_11 for Windows) without garbage collection occurring first? I've tried the -XX:+PrintClassHistogram option, but this always seems to garbage collect before printing the histogram.
    My problem is that I see heap usage increasing very rapidly in the JVM, then garbage collection occurs and reduces memory usage back down to what it was before. However, this results in the JVM spending a large amount of time garbage collecting. I would like to be able to see the contents of the heap before GC occurs.
    These are the options I've tried so far:
    * Using -XX:+PrintClassHistogram. As mentioned above, this always garbage collects before printing the histogram.
    * Using -XX:+HeapDumpOnOutOfMemoryError. The problem is that the JVM always manages to GC before running out of memory, so never dumps the heap.
    * Using the jmap tool. Unfortunately I'm running Windows (in production), so this is not available for 1.5.
    * Using HPROF. However this seems to slow the JVM down hugely (whenever I use -agentlib:hprof=heap=sites or -agentlib:hprof=heap=dump).
    * Using the HeapViewer demo tool that comes with the JVM. This has the same effect as PrintClassHistogram and garbage collects before outputting.
    * Using JProfiler. Unfortunately it seems (with the 1.5 JVM anyway) the Concurrent Garbage Collector cannot be used in conjunction with JProfiler (I think this is a JVM TI issue?). With the Parallel GC we don't see the same problem (probably mostly because throughput is crippled with the Parallel GC).
    * Using jstat. This only gives us statistics about how much has been garabge collected, not which objects were collected.
    Has anybody got any other suggestions?
    Thanks.
    Neil.

    Hi all.
    Just an update on this -- I couldn't find any way to do this in Java 1.5 (on Windows).
    In Java 1.6 (and maybe in 1.5 on other platforms) jmap will do a heap dump without garbage collecting.
    I also came across an open source memory profiling tool called Ariadna (see http://mernst.org/ariadna/) which seems to work quite well. It was only of limited use in Java 1.5 however, since JVM TI doesn't support the concurrent garbage collector in this version.
    Hope this is helpful anyway. I'll be trying to get upgraded to 1.6 ASAP!
    Thanks.
    Neil.

  • Garbage collection Java Virtual Machine : Hewlett-Packard Hotspot release 1.3.1.01

    "Hi,
    I try and understand the mechanism of garbage collection of the Java Virtual Machine : Hewlett-Packard Hotspot release 1.3.1.01.
    There is description of this mechanism in the pdf file : "memory management and garbage collection" available at the paragraph "Java performance tuning tutorial" at the page :
    http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1607,00.html
    Regarding my question :
    Below is an extract of the log file of garbage collections. This extract has 2 consecutive garbage collections.
    (each begins with "<GC:").
    <GC: 1 387875.630047 554 1258496 1 161087488 0 161087488 20119552 0 20119552
    334758064 238778016 335544320
    46294096 46294096 46399488 5.319209 >
    <GC: 5 387926.615209 555 1258496 1 161087488 0 161087488 0 0 20119552
    240036512 242217264 335544320
    46317184 46317184 46399488 5.206192 >
    There are 2 "full garbage collections", one of reason "1" and one of reason "5".
    For the first one "Old generation After " =238778016
    For the second "Old generation After " =238778016
    Thus, "Old generation Before garbage collection" of the second is higher than "Old generation After garbage collection". Why?
    I expected all objects to be allocated in the "Eden" space. And therefore I did not expect to s

    I agree but my current Hp support is not very good on JVM issues.
    Rob Woollen <[email protected]> wrote:
    You'd probably be better off asking this question to HP.
    -- Rob
    Martial wrote:
    The object of this mail is the Hewlett-Packard 1.3.1.01 Hotspot JavaVirtual Machine
    release and its garbage collection mechanism.
    I am interested in the "-Xverbosegc" option for garbage collectionmonitoring.
    I have been through the online document :
    http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/hotspot.html#-Xverbosegc
    I would like to find out more about the garbage collection mechanismand need
    further information to understand the result of the log file generatedwith the
    "-Xverbosegc"
    For example here is an extract of a garbage collection log file generatedwith
    Hewlett-Packard Hotspot Java Virtual Machine. Release 1.3.1.01.
    These are 2 consecutive rows of the files :
    <GC: 5 385565.750251 543 48 1 161087488 0 161087488 0 0 20119552 264184480255179792
    335544320 46118384 46118384 46137344 5.514721 >
    <GC: 1 385876.530728 544 1258496 1 161087488 0 161087488 20119552 020119552 334969696
    255530640 335544320 46121664 46106304 46137344 6.768760 >
    We have 2 full garbage collections, one of Reason 5 and the next oneof Reason
    1.
    What happened between these 2 garbage collections as we got : "Oldgeneration
    After" of row 2 is higher than "Old generation Before" of row 1? Iexpected Objects
    to be initially allocated in eden and so we could not get "old generation2modified
    between the end of one garbage collection and before the next one.
    Could you please clarify this issue and/or give more information aboutgarbage
    collection mechanisms with the Hewlett-Packard Hotspot Java VirtualMachine. Release
    1.3.1.01.

  • When will wls try to garbage collect ?

    The docs for the option "Low memory GC threshold" say that this is the "Threshold
    level at which WLS will try to garbage collect once the granularity report has
    been met".
    My question is: When is this condition met ? If at least once there has been a
    granularity report in the log ? Or if the server has been set to Warning state
    The problem Im trying to address is that my "Low memory GC threshold" is set to
    20% and my server has reached only 1% free memory and garbage collection did not
    run, I had to force it via console.
    Thanks in advance, Giselle

    I am wonder when the WLS activate or passivate session and how can I          control it?
              > From documents, sessionWillPassivate in HttpSessionActivationListener will
              be
              > executed when a session is about to passivate on one server (ie. WLS
              instance)
              > and the sessionDidActivate method when the same session has been activated
              on
              > a second server.
              >
              > But I have monitor the behavior for a long time by setting
              PersistentStoreType
              > to file, memory, replicated. sessionDidActivate and sessionWillPassivate
              will
              > never executed. I expected it will passivate and activate when session is
              replicated
              > between servers or persist in files. Any ideas?
              What version of WL? the interface you describe was new in Servlet 2.3, so it
              may not be implemented until 6.1 or even 7.x.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Karen Law" <[email protected]> wrote in message
              news:3ec86188$[email protected]..
              >
              

  • Reconciling garbage collection, heap overview, and object stats

    First, both the JRockit RuntimeAnalyzer and Console are great tools. We use
    them extensively so thank you.
    I'm trying to reconcile the numbers in these three tabs.
    1. How do I reconcile the Runtime Analyzer and Console output?
    - The Heap overview tab in our application profile shows Heap Overview as
    83% free.
    - However, the Garbage Collection tab of the profile and Console shows the
    application as oscillating between 50 Meg and 200 Meg of heap used. That's
    25% (50Meg/200Meg) to 100%(200Meg/200Meg) used. How do I interpret the 83%
    vs. the 100%?
    I don't believe the 83% free, but I'm skeptical that we consume 150Meg of
    memory in 50 seconds.
    2. How do I reconcile the Object stats with the Garbage collection?
    - Take the top heap user at end of recording, character buffer. It's 22.8%
    of heap using 6,328 KB. If the heap is actually only 34Meg ( 17% of 200Meg.
    I get the 17% from the 83% free), then 22.8% makes sense.
    - So what's in the 200Meg of heap?
    I sent this recording to the JRA team if you want to look at it.
    Thanks
    Jeff

    I've never heard it put that way. Very interesting.
    "Johan Walles" <johan@spamalamadingdong> wrote in message
    news:41bf0be3@mail...
    Note that the time it takes for the garbage collector to do its thing
    grows with the amount of live data.
    What the garbage collector really does is more like retaining the live
    data than disposing of the garbage.
    Regards //Johan
    Jeff wrote:
    Staffan,
    Thanks - you clearly answered my questions. Now the follow-on questions:
    1. Is there a way to get insight into what the 'dead' data is composed
    of?
    2. Is this pattern of consuming 3x the live data in about a minute
    'typical' or a disaster in the making?
    I'm trying to get a sense of what a reasonable target of 'dead' data is.
    The system processes about a meg of data per second, including database
    writes.
    Thanks
    Jeff
    "sla" <[email protected]> wrote in message
    news:33533893.1102952170368.JavaMail.root@jserv5...
    Hi Jeff,
    I'll try to answer the questions.
    1) The Heap overview in the application profile is a snapshot of the heap
    at the end of a garbage collection. At this time only live data is still
    on the heap. So it looks like you have 17% of the heap filled with live
    data (and some overhead as seen in the Heap overview).
    In the garbage collection tab you can see the heap usage oscillating
    between 35-40MB and 200MB. The lower value is right after a garbage
    collection and the higher value is right before a garbage collection. The
    garbage collector clears out about 160MB of "dead" data from the heap.
    This is the amount of temporary objects that you created during the
    garbage collection cycles.
    2) The Object statistics are also taken right after a garbage collection.
    At this time there is 34M of live data on the heap and of these about 22%
    is taken up by character arrays (not unusual).
    At this time the rest of the 200MB heap is empty. It's been cleared of
    all temporary objects and is ready for allocation of new objects.
    I hope this answered your questions.
    Regards,
    /Staffan

Maybe you are looking for