Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how does gargbage collecton works internally ??

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    1
    My Mood
    Happy
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how does gargbage collecton works internally ??

    I am not getting the life cycle of garbage collector and will it call finalize() method internally?


  2. #2
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    472
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: how does gargbage collecton works internally ??

    There are various strategies employed by garbage collectors, but usually they check to see whether an object is accessible (has references to it) and, if not, they flag it as eligible for collection. When memory runs low, objects eligible for collection may have their finalize method called and their memory released for reuse.

    There is no guarantee that an object's finalize method will ever be called, even if it becomes eligible for collection.

    For details Google 'java garbage collection'.

Similar Threads

  1. GUI Only Works Sometimes
    By bgd223 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 12th, 2011, 08:08 AM
  2. jar file works on XP but not on Linux
    By cl2606 in forum Java Theory & Questions
    Replies: 1
    Last Post: June 10th, 2011, 09:19 AM
  3. This program works but Want to improve
    By SHStudent21 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 8th, 2011, 05:53 PM
  4. [SOLVED] Can someone verify if this code for deleting a BST works?
    By scottb80 in forum Java Theory & Questions
    Replies: 2
    Last Post: November 2nd, 2010, 10:19 AM
  5. How overloaded paint() works?
    By maikeru in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 21st, 2009, 06:13 PM