Thanks for the helpful information. When I was asking about the policy on garbage collection, what I meant to ask was, is the garbage collector guaranteed to run (in a normal execution of a JVM, that is, one that does not crash) at least once?
Regards, John John Ghidiu Benderson Development Company Inc. [EMAIL PROTECTED] (716) 878-9376 -----Original Message----- From: H Shankaranarayanan [mailto:[EMAIL PROTECTED]] Sent: Friday, June 28, 2002 08:03 To: JDJList Subject: [jdjlist] Re: Heap Size of the JVM The GC WILL run in applications which run for a longer timeframe and these mostly fall into the server category. The servers consume memory for each client connection coming in and over the course of time end up making a lot of holes in the heap these are all aggregated and released by the GC at the time of a memory crunch. A GC typically runs only when a memory crunch occurs. The total memory Vs freememory of the Runtime would help in understanding this. The total memory increases till the default heap size which is 64 MB and crash if more is required. Each time the freeMemory is zero and the total memory has not reached 64 MB yet more memory is obtained from the underlying OS. The GC thread also comes into picture at the same point. Of course on high end machines you could configure for a bigger heap and get away with it. And could you elucidate wot "policy on the garbage collector" means? Thanks, Shankar -----Original Message----- From: John Ghidiu [mailto:[EMAIL PROTECTED]] Sent: Friday, June 28, 2002 5:13 PM To: JDJList Subject: [jdjlist] Re: Heap Size of the JVM Speaking of GC, what is the policy on the garbage collector running? At one of the .NET sessions at JavaEdge, there was a little controversy about the GC. Is the GC guaranteed to run at least once? Or not at all? Regards, John John Ghidiu Benderson Development Company Inc. [EMAIL PROTECTED] (716) 878-9376 -----Original Message----- From: H Shankaranarayanan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 00:16 To: JDJList Subject: [jdjlist] Re: Heap Size of the JVM The Memory on the heap is traversed by the GC like a normal tree traversal and the unreachable parts of the memory would be automatically reclaimed (if the references dont exist on the main tree i.e.). The singleton is a separate tree here and if its reference is not held by any other object references on the main line tree it is collected. hope this answers u r qn --Shankar -----Original Message----- From: Mary Dale [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 8:40 PM To: JDJList Subject: [jdjlist] Re: Heap Size of the JVM Do you know if the reference is in the object itself - as you might have for a static reference to a singleton, can it be garbage collected? Thanks Kevin Mukhar <kmukhar@earthli To: "JDJList" <[EMAIL PROTECTED]> nk.net> cc: Subject: [jdjlist] Re: Heap Size of the JVM 06/25/2002 07:58 PM Please respond to "JDJList" Java exams wrote: > >-- Narasimhan Sethuraman <[EMAIL PROTECTED]> wrote: > > Setting objects as null will make the object > > eligible for GC > > That should read "may make". If there are other > references to the object ( perhaps another reference > to the exists in a Hashmap or Hashtable somewhere ), > it will only be eligible once all references to the > object have been cleared ( otherwise the object is > "retained" ). Actually, to be precise, the object becomes eligible for garbage collection when it becomes unreachable. One way to do this is to remove all references to the object. However, to use your example, one can have a reference stored in a Hashmap that is non-null, yet if all references to the Hashmap are removed, then the object in the Hashmap is unreachable and thus also eligible for garbage collection. To change your membership options, refer to: http://www.sys-con.com/java/list.cfm ******************* PLEASE NOTE ******************* This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help. ********************************************************** To change your membership options, refer to: http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm To change your membership options, refer to: http://www.sys-con.com/java/list.cfm
