From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e80a1497a689d8a5 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: Ammo-zilla Date: 1999/11/01 Message-ID: <381D01EC.429FF03B@research.canon.com.au>#1/1 X-Deja-AN: 542939089 Content-Transfer-Encoding: 7bit References: <38120FAF.945ADD7D@hso.link.com> <7uutgd$87h$1@nnrp1.deja.com> <19991024.18033546@db3.max5.com> <38189268.43EB150F@mail.earthlink.net> <86ogdjtdwz.fsf@ppp-115-70.villette.club-internet.fr> <7vadsp$8q61@news.cis.okstate.edu> <1999Oct28.221910.1@eisner> <7vb3c4$8a21@news.cis.okstate.edu> <7vc2er$128q$1@news.gate.net> <7vco1c$ohs@drn.newsguy.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@research.canon.com.au X-Trace: cass.research.canon.com.au 941425109 19702 203.12.174.227 (1 Nov 1999 02:58:29 GMT) Organization: Canon Information Systems Research Australia Mime-Version: 1.0 NNTP-Posting-Date: 1 Nov 1999 02:58:29 GMT Newsgroups: comp.lang.ada Date: 1999-11-01T02:58:29+00:00 List-Id: mike@home wrote: > > In article <7vc2er$128q$1@news.gate.net>, "David says... > > >I often wished when writing Java code that I could force the JVM to clean up > >what I wanted, when I wanted. > > > >David Botton > > you can do that. just call the gc(). to clean you local objects, assign > 'null' to them first. > Explicitly calling the GC is VERY expensive, so you really don't want to do it more often than necessary - and the JVM knows when it is necessary. For the Java I write, performance is important, and I find myself programming to avoid the GC. For "hot" classes I allocate a pool of objects up front, then reuse them, instead of leaving them to the GC. I also give the JVM heaps of memory. BTW, has anybody noticed that Java finalization is broken. System.runFinalizersOnExit is deprecated, so you can't tell if finalizers will ever be run - making them almost completely useless.