Resources garbage collection, can be done this way ?

The problem
I would like to apply the same concept of garbage collection to system resources like Files, Database resulsets, Sockets etc...
The reasons
I am tired of looking around desperately into a program to identify memory leak that are instead resources leak. And this is getting worse while program size grows.
How it could be done
-- Let's have a resource manager class from where I get the wanted resource (I will write this class, fairly easy).
-- Let's say that this manager class is a thread that runs in a scheduled way and this is decided by me (this is also something anybody can write).
-- Let's say that when it runs it checks for all resources (objects) that it has given to the rest of the program if the reference count greater than one. If it is > 1 then the resource is still in use, else it can be deallocated (that just means calling close and then leaving the object to garbage collect).
What I need
A way to know in a reliable way how many objects are having a reference to a given object. Is there such a way ?
Evangelism on..
Please, if anybody at Sun is reading this, this IS a TOP issue. If you look around you will see more and more issues of leaking, they are resources leakage because it is NOT easy to ALWAYS close a resource.
Someone may say "use the finally" of yes, try to think to use the finally to deallocate memory and you will immediatly understand the mess that will come.
Garbage collection is a good idea let's have a way to apply it to resources.
Thanks

I have no problem, as it is, in making applications
reliable.As usual the problems come in deciding how to do
things.Yes.
>
Which is why mine don't. Since resources are usedin
so few places it is easy to manage their usage.We are not talking on who has the biggest gun...Eh?
>
The sad thing is that the problem most of
the time is NOT yours but of somebody else thatforgot
to clean up after himself...Sounds more like a management problem than a code
problem. If you are allowing programmers in your
organization to write code which leaks resources oris
so poorly designed that other users can notproperly
dispose of resources then it is a managementproblem.
Ok, let's drop it here.
I hope you will never have to deal with code other
that yours or written by your coworkers.
I always deal with other people's code. And they with mine. Although I occassionally work on one person projects - perhaps 2 weeks every three years. the rest of my career has always involved multi-person projects and often (if not always) involve third party libraries.
So I believe I have dealt with others code.
in the applications that I work on.)There is java.lang.ref in a way it seems to dowhat
I
want....
I don't believe so. Finalize() more closely fitswhat
you might want to do. java.lang.ref is used in
building caches of disposable entities. And it is
most definitely only useable with memory.I have a funny sensation that whatever I write you say
no...Not necessarily.
Thanks for your help, if anybody wants to add
something useful to
what I am tryng to do they are welcome.I am trying to be useful.
I am trying to point out that you are looking for a new feature in the language that just isn't very useful to most people. I was trying to point out why it wasn't useful to most people.
Perhaps this might help.
Look at it this way, go look at the bug database and look at the top vote getters for things that people want fixed. Then you might trying looking through the RFEs for something like you want. If it isn't there then add it. If enough people actually want it then it will be voted for. With enough votes it would have a better chance of being added.
Of course that presumes it could be done in the first place. Based on my memory of past topics in the forums on reference counting I suspect that the answer is no. But you might want to read those.

Similar Messages

  • Edge feather - why is it done this way?

    I wanted to feather the edge of a clip in Motion just like I've done in FCP. I went to the "crop" parameters in Motion expecting to find the edge feather option just like FCP . . .it wasn't there.
    I figured out that I have to apply a mask first and then feather the mask.
    I'm just wondering why it would be done this way in Motion. I can understand that a mask would be more versatile, but why not include a simple "edge feather" option for those frequent times that someone would just want a quick feather?
    Just curious. Any thoughts about that?
    Thanks!

    Jeff Geisel wrote:
    My plan for next time was to feather the edge in FCP then export as Quicktime Movie. Then import the movie into Motion.
    That's just silly, Jeff. You're adding three steps in FCP to avoid ONE step in Motion. On top of that, you're engaging in destructive editing to do so.
    Far be it from me to try to change a person's "workflow", but I suggest again that you'll be happier in the long run learning how to feather in Motion.
    Andy

  • Please tell me if I can use BitSet this way ;

    Please set me right if I'm asking this question in the wrong forum. I am trying to write an object that contains values in a BitSet into a file using ObjectOutputStream. I loose the values upon reading the object back from the file using ObjectInputStream. What am I doing wrong? Am I way off even trying to do this?
    thanks

    Yes you can use it that way... maybe you could post your code as there may be another problem. The following code produces the correct result:
      public static void main( String[] args ) throws Exception {
        File f = new File( "c:/bitset" );
        ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream( f ) );
        BitSet set = new BitSet(3);
        set.set(0);
        set.set(2);
        System.out.println( set );
        out.writeObject(set);
        out.close();
        ObjectInputStream in = new ObjectInputStream( new FileInputStream(f) );
        BitSet set2 = (BitSet)in.readObject();
        System.out.println( set2 );
        in.close();
      }

  • Upgrading hard drive - can it be done this way?

    I'm very interested in upgrading my hard drive of my macbook pro, I have time machine connected to a WD Mybook and it has given me nothing but problems... randomly disconnecting, and I've tried it with both firewire and usb. I don't want to rely on that to recreate my hard drive so:
    Can I take the new laptop hard drive, plug it into an external enclosure, and then clone my current hard drive on to it?
    What is the simplest procedure/software that I can use to do it? Is there something built into Leopard that will automate the process?

    I just set up a 320 GB WD Scorpio for a backup with 2 bootable clones using Super Duper, with the idea I may eventually put it into my MBP. I haven't done the transplant yet, but I have verified that I can boot from any of the 3 volumes, and you need to boot at least once from the clone you are making to test it out.
    My understanding is that the Mac will try to boot from whatever it booted from the previous time. If it can't find that volume, it will look for another one to boot from and boot from that.
    To get the Mac to boot up from your external disk, go to System Preferences> Startup Disk and select it as your startup disk and restart. When it starts, you will see both the external and the internal on the desktop, with the one you booted from on top. It should continue to boot from that drive until you tell it otherwise.
    Right now your external will have the firewire icon and the internal will have the Macintosh HD icon. Once you put the new one in, it will have the Macintosh HD icon and might even be named Macintosh HD. Or you might have to name it. If you put the old one in your enclosure, it will now have the firewire icon.
    Hard drives are just hard drives. It doesn't matter that the WD was once in an enclosure and used as an external.
    Does this answer your question? If not, please post back.
    Good luck!

  • Idoc packaging - Can it be done this way?

    I am just thinking about -
    creating a ZIDOC - which would have structures - of type another idoc - say HRMD_A07 (0 to Unbounded). In the other words,
    <ZIDOC>
    <HRMD_A07></HRMD_A07>
    <HRMD_A07></HRMD_A07>
    <HRMD_A07></HRMD_A07>
    </ZIDOC>
    I am not sure if I am putting it correctly...Just have an idea.

    Hi,
    Do you need some thing like..
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Regards,
    Sunil.

  • Memory leak in java / forcing garbage collection for unused resource?

    Is there any possibility in big programs if not designed properly for leakage of memory?
    If say i forget to force garbage collection of unused resouces what will happen?
    Even if i am forcing garbage collection how much assurity can be given to do so?
    I need answers w.r.t typical programming examples if someone can provide i will be happy.
    Or any useful link.
    Thanks
    Vijendra

    Memory leaks are usually much related with C/C++ programming since in that language you have direct access to memory using pointers.
    Now, in Java you do not have access to pointers, however you could still tie up your objects in a way that the garbage collection can not remove them.
    Basically, the grabage collection will search all the object implementation, and see if they are referenced or not. If not it will free that memory. However if you, somehow in you code allow a reference to your object then the garbage collection will not displose of that object.
    An example I can think of is when developing web applications. For example storing objects in the session will mean that you will have a reference to the object from the session, therefore the garbage collection will not free up the meomry taken by those objects untill the session has expired.
    That is how I know it... at least that is how they tought it to me!
    regards,
    sim085

  • I just bought a new ipad 2, but cannot use it as it only shows the itunes logo and a cable. This means it's telling me to connect to itunes. I've done this and performed sync, still no way out. I have been told by friends to "unlock" it. Please how?

    I just bought a new ipad 2, but cannot use it as it only shows the itunes logo and a cable. This means it's telling me to connect to itunes. I've done this and performed sync, still no way out. I have been told by friends to "unlock" it. Please how?

    Have you already activated the iPad? That is what the screen is telling you to do - connect to the computer with the supplied cable and run iTunes while connected - and iTunes should guide you through the set up process. If you have already set up the iPad and you are still getting thos screen message - restore your iPad. You must be running iTunes 10.5 on your computer as well.
    Restore iPad
    If you can't restore this way, you will need recovery mode.
    Unable to Restore

  • Applescript: force garbage collection?

    Hello
    I am trying to call applescript functions (from my cocoa application - using NSAppleScript's -executeAndReturnError), to automate some operations in Microsoft Word.
    The problem is that after every Applescript call, the Word operates slower and slower (and i guess finally it won't respond at all). I am calling operations, like "set myvar to all words of current document whose [some conditional]" or "set myvar to all fields of current document whose [some conditional]" (which are memory consuming - on each call Word enumerates all the words of a long document, searches there some matches, etc), and i think that after each call of NSAppleScript's -executeAndReturnError, Word doesn't clean its previous "results", which slows it down with every next call. I wanted to try to do an explicit call of Applescript's garbage collector after each -executeAndReturnError from my Cocoa app, maybe that could eliminate the problem i have.
    But i didn't find any info on how to do that. Java, ActionScript - both have System.gc() functions (that launch Garbage collection if it's needed right here and right now). If theres no way to force garbage collecting in AppleScript, maybe someone knows "implicit ways", when AppleScript engine calls it? Like the next iteration of a loop, or some other conditions? Or some timespan, after passing which the GC is called?
    What could cause that slowness of Mac:Word? Is it a mistake of Microsoft, or am i forgetting to do something? If someone could advice readings about how applications usually implement Applescript interface "from the inside" (and who is responsible for cleaning the results of each call), i'd be very thankful.
    Thanks for any advice!
    George

    If you really want to see the results you should also run the finalizer
    thread on the newly garbage collected objects. It might take up to 2 GC
    cycles for the memory to be actually free for new allocation at least on
    the Sun JVMs. Maybe the new types of garbage collectors do it better or
    more optimized but anyway, the GC would first mark the objects and only
    then the finalizer will run to call the finalize method. Then next GC
    will free the memory of the finalized objects.
    HTH,
    Dejan
    Dinesh wrote:
    Hi Slava Imeshev,
    Thanks for immediate response. I agree JVM will do GC at specific interval. But,
    I have found that , there is some difference in both of them. If you invoke "Force
    Garbage Collection" explicitly, the graph will show the heap memory usage to baseline.
    Where in, if you perform System.gc(). It won't make much difference.
    Thus why, I want to know what is the code behind the "Force Garbage Collection"
    button.
    Thanks,
    -Dinesh.
    "Slava Imeshev" <[email protected]> wrote:
    "Dinesh" <[email protected]> wrote in message news:406a8df4$[email protected]..
    How can i schedule "Force Garbage Collection" to be done at every
    week or daily?.
    Can i automate this process instead of manually invoking the button?
    GC is already done by JVM automatically.
    Why would you want to "schedule" it?
    Regards,
    Slava Imeshev

  • 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();

  • Howto Force Garbage Collection manually in Oracle Application Server

    Hi,
    I have a Oracle SOA suite installed on Oracle 10g Application Server. The heap memory for the SOA oc4j container is 2G with a permgen space of 256M. But it looks like there is some memory leak somewhere and the Heap area is getting filled frequently and this causes an *[libopmnoc4j] OC4J ping attempt timed out* and as a result of this the SOA oc4j container gets restarted automatically.
    Is there any means by which we can force a Garbage Collection manually so that this automatic restart does not happen.
    Kindly let me know if it is possible to trigger a Garbage Collection manually in Oracle Application Server.
    Thanks,
    Vijay.

    We had a similar situation where the oc4j instance will throw OutOfMemoryException and opmn will restart a new instance every 10-12 hours. The JDBC 10.2.0.3 driver has a memory leak in the XA Resource classes. There is a fix available in metalink.

  • Increasing the priority of garbage collection

    We have a JNI application that is running under a very heavy load. The problem is that the garbage collection can't catch up with the application. This creates a problem that looks like a memory leek, we consume more and more memory.
    Is there a way to solve this? Perhaps by increasing the priority of the garbage collection thread?

    We have a JNI application that is running under a
    very heavy load. The problem is that the
    garbage collection can't catch up with the
    application. This creates a problem that looks like a
    memory leek, we consume more and more memory.
    Is there a way to solve this? Perhaps by increasing
    the priority of the garbage collection thread?Addressing this is detail.....
    First normally the JVM is free to grab all the memory that it is allowed to. It doesn't have to give anything back to the OS, regardless of whether it is using it or not.
    There is a way to tune that but I doubt that is going to help you because if you are actually using the memory (which a "very heavy load" would suggest) then the VM needs the memory.
    Secondly why do you consider this a problem? If you are getting an out of memory error then either you have a memory leak or your application needs more memory. And in neither case is the gc going to help.
    Now perhaps what is really happening is that you are getting a full gc and that is impacting the application. And you are hoping that there is someway to make the incremental gleaner run faster. There might be. It would be one of the XX options. But again this, in of itself, is not going to normally return memory to the OS.

  • Disabling RMI Explicit Garbage Collection

    I have an application that uses RMI. From different articles on the javasoft web site, I have read that RMI explicitly does a Full RMI every minute (default setting). This is undesirable, b/c these full GCs are causing some objects I need to use later to be garbage collected. From the site, the options are to:
    1) Disable Full GC
    2) Delay Full GC
    For point 1), what are the consequences of disabling explicit full GCing that RMI does? Documentation on the javasoft website only says that "this may also cause some objects to take much longer to be reclaimed" etc. To me, I would think that disabling the explicit Full GC is a bad idea for RMI applications (unless they are really short lived, but that is not my case). It would seem safer to go with 2) option to delay the Full GCs since it's not entirely clear what the consequences are of completey disabling explicit GCs, but this still causes objects I still need to use later to be garbage collected. The last option which I feel is not very elegant, would be to just set something to reference or use that object that is being gc'ed so when a Full GC is performed it doesn't get cleaned up. Does anyone have any experience with this or have any better suggestions?
    I am using Java 1.4.2 currently, but am also interested in learning what would be good for Java 1.2.X and 1.3.X as well.
    Thanks!
    These are the links that I have already visited or docs that I have already read on this topic:
    1) Java 2 Platform, Standard Edition v 1.4 Performance and Scalability Guide
    http://java.sun.com/j2se/1.4/performance.guide.html
    2) Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine
    http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
    3) Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1
    http://developers.sun.com/techtopics/mobility/midp/articles/garbagecollection2/#11.1.3.15
    4) Garbage Collection for Remote Objects (1.4.2)
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi/spec/rmi-arch4.html

    Towards the end of my pot I wrote:
    The last option which I feel is not very elegant, would be to just set something to reference or use that object that is being gc'ed so when a Full GC is performed it doesn't get cleaned up. Does anyone have any experience with this or have any better suggestions?
    I realize that I can reference these objects, but I don't think that is really a great solution. This would mean deliberately referencing them (a hack at a solution in my view) when really it's the explicity GC running every minute (b/c of RMI) that is collecting them. If I turn the explicit GC off, my objects are not collected like this.
    My question was really does anyone have any better ideas or experience with RMI's explicit garbage collecting? I don't need to read a tutorial to tell me how to keep my objects alive by referencing them. Thanks.

  • One website creates havoc with my iMac - what can be done?

    I am an administrator for our church website. When I go on it to work, after about 10 minutes either Safari or Firefox, whichever I'm using, freezes completely. I have to force quit and restart about every 10 minutes. In fact it isn't only that it freezes, the website plays havoc with my computer. I took two days to dump preferences, use disk utility, get mail back on line and it was working perfectly. Last night I went on the website, and instantly, the computer froze and I lost not only what I'd just posted but an entire page of other information!
    I've done enough testing now to know this only happens on that website. First of all, is this even possible that a website can do such damage? I'm on websites all day and have never had anything like this. I post on chatboards with no difficulty; no problem with Facebook. If it is possible, then is there something I can do to fix this? I love working on the website but I can't continue this way. I wondered if this is a frequent enough problem that someone might know a setting or some other adjustment that needs to be made to my Mac to make it work.
    I don't know if this is related to 10.6 or not because I have only done the website since I installed Snow Leopard. I have written the company who owns the site to see if they know of anything, but this is really mystifying. It is stunning what 5 minutes on the website will do to my computer! It is almost completely inoperable until I dump some preferences and do other things.
    Thanks for any insight you might have.

    One other thing I've noticed is that the problem worsens over time. When I first go on, it is okay...then in 10 minutes it is starting to act very strangely, and at 15 minutes, the whole thing is frozen. Then I dump the Safari preference files and restart and it works wonderfully....for 10 minutes.
    Then the fireworks start. Today, weird pages were flashing up that I've never seen before....like the introductory page to Safari..."Welcome to Safari 4.1" I've never seen that page in my life. It's more than just freezing, it goes crazy. Because it starts to work again when I dump the prefs, It seems like something is corrupting them. To have to dump them every 15 minutes is really strange.

  • My child accidentally rented a movie on Apple TV.  Is there a way to refund the rental if we don't watch it?  How can I prevent this from happening?  Is there a way to password protect future purchases?

    My child accidentally rented a movie on Apple TV.  Is there a way to refund the rental if we don't watch it? 
    How can I prevent this from happening?  Is there a way to password protect future purchases?

    Did you try Parental Controls?
    Apple TV: Understanding Restrictions (parental controls) - Apple Support
    See if that does the trick: I think there's a way for you to request a password for purchases, but still be logged in.

  • Is there a way to select MULTIPLE tabs and then copy ALL of the the URLs and titles/or URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; However, I prefer to use a Firefox feature rather than download an add on. Thanks.

    Currently, I can copy ONE tab's url and nothing else (not its name). Or I can bookmark all tabs that are open. However, I'd like to have the ability to select multiple tabs and then copy ALL of the the URLs AND their titles/or copy ALL of the URLs+titles+HTML links? This can be done with the Multiple Tab Handler add on; when I download the add on, I get a message saying that using the add on will disable Firefox's tab features. I prefer to use Firefox features rather than download and use an add on. Is there a way to do this without an add on?

    Hi LRagsdale517,
    You should definitely be able to upload multiple files by Shift-clicking or Ctrl-clicking the files you want to upload. Just to make sure you don't have an old version of the service cached, please clear the browser cache and then log in to https://cloud.acrobat.com/files. After clicking the File Upload icon in the upper-right corner, you should be able so select multiple files for upload.
    Please let us know how it goes.
    Best,
    Sara

Maybe you are looking for

  • IPhoto importing 100's of useless images upon first use, how to undo?

    I just accidentally opened iPhoto, and next thing it started importing all these useless images from somewhere, 100's of them, and they all look the same.... I couldn't stop it. Does anyone know a quick way to undo this?

  • Dv5 / dv6 / dv7 webcam not detected - one (possible) solution

    There are SO many posts on webcams - here is something for those of you who no longer have warranties and need help. Background:  I just purchased a new dv7 - no webcam detected!  I tried everything I could think of and ended up sending the system in

  • Copyvalue from context -- check number of entries

    Experts, Iam facing an issue where i need to copy values from the first entry only if there are no more entries in the context Sometimes i see multiple entries in the context. each entry in the context is sent to the new record as a field value.so i 

  • Spinning beach ball - won't shut off

    Came back from a weekend away to find that my MacBook pro, which I'd left running on top of my bed, with a grey screen and the spinning beach ball icon. Tried powering it off to no avail. Any suggestions for me? Anybody?

  • Error message: Internal error: T XNACH F KONDITION_ZUORDNEN I MV13BF0K

    Dear all, May I know what is the reason of the following error message when I try to access MN22 and MN23? Internal error: T XNACH F KONDITION_ZUORDNEN I MV13BF0K Message no. VK067 Please help. Thanks. Tuffy