public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: "BGB" <cr88192@hotmail.com>
To: "Chris Gray" <mbx03025@scarlet.be>
Cc: "aph" <aph@redhat.com>, 	"abhi00" <abhi00@gmail.com>,
		"java" <java@gcc.gnu.org>
Subject: Re: Calling the garbage collector.
Date: Mon, 27 Jul 2009 16:16:00 -0000	[thread overview]
Message-ID: <BLU0-SMTP57586646BF92F5843CC249E4140@phx.gbl> (raw)
In-Reply-To: <KNG62F$A29CFBDE0DD882E74454F231B9825EE4@scarlet.be>


----- Original Message ----- 
From: "Chris Gray" <mbx03025@scarlet.be>
To: "cr88192" <cr88192@hotmail.com>
Cc: "aph" <aph@redhat.com>; "abhi00" <abhi00@gmail.com>; "java" 
<java@gcc.gnu.org>
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...


  reply	other threads:[~2009-07-27 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 15:37 Chris Gray
2009-07-27 16:16 ` BGB [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-07-27  9:41 abhishek desai
2009-07-27 10:07 ` Andrew Haley
2009-07-27 14:43   ` BGB

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLU0-SMTP57586646BF92F5843CC249E4140@phx.gbl \
    --to=cr88192@hotmail.com \
    --cc=abhi00@gmail.com \
    --cc=aph@redhat.com \
    --cc=java@gcc.gnu.org \
    --cc=mbx03025@scarlet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).