From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19800 invoked by alias); 27 Jul 2009 16:16:13 -0000 Received: (qmail 19789 invoked by uid 22791); 27 Jul 2009 16:16:12 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from blu0-omc2-s34.blu0.hotmail.com (HELO blu0-omc2-s34.blu0.hotmail.com) (65.55.111.109) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jul 2009 16:16:03 +0000 Received: from BLU0-SMTP57 ([65.55.111.72]) by blu0-omc2-s34.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Jul 2009 09:16:01 -0700 Message-ID: Received: from gammaxp64a ([174.18.208.144]) by BLU0-SMTP57.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Jul 2009 09:16:01 -0700 From: "BGB" To: "Chris Gray" Cc: "aph" , "abhi00" , "java" References: Subject: Re: Calling the garbage collector. Date: Mon, 27 Jul 2009 16:16:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg00075.txt.bz2 ----- Original Message ----- From: "Chris Gray" To: "cr88192" Cc: "aph" ; "abhi00" ; "java" Sent: Monday, July 27, 2009 8:37 AM Subject: Re: Calling the garbage collector. - > hmm... > > maybe Java needs 'delete'?... <-- As in "maybe the pope needs a wife"? :-) Automatic garbage collection means you don't know when garbage will be collected, it could even be "after the VM exits", i.e. never. Running all finalizers when the VM exits has been tried, and it was a disaster. http://www.velocityreviews.com/forums/t145751-finalize-not-guaranteed-to-be-called-ever.html http://www.hpl.hp.com/personal/Hans_Boehm/popl03/slides.pdf etc.. PS I'm happy to report that the Mika VM also does not run your finalizer. :-) --> I was partly joking, but yeah, GC is has some good points, and manual MM some others. personally, I prefer a hybrid strategy, where memory can be manually freed/destroyed when it is known that it is not needed anymore, and left for the GC when the usage pattern is "difficult to determine". in my projects, I use a GC, but much of the time treat it much like good old malloc/free... so, in cases where it matters, one could essentially force the finalizer to be run and the object to be freed...