Results 1 to 4 of 4
  1. #1
    vivek6569 is offline Member
    Join Date
    May 2011
    Location
    bangalore
    Posts
    4
    Rep Power
    0

    Default i m so confuse in garbage collection

    What is garbage collection?(use of it and how it is implemented)?

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    5

    Default

    The JVM maintains a list of objects that are accessible to your program and automatically reclaims the memory from those that are not. It's not something you'll probably ever have to concern yourself with.

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,005
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by vivek6569 View Post
    What is garbage collection?(use of it and how it is implemented)?
    The garbage collector marks unused (but previously used) memory and makes it available again for your program. Garbage collectors have come a long way; the early GCs completly froze your program while they were doing their job. You don't really have to pay attention to the GC, i.e. just let it do its job and everything will be fine. If an OutOfMemoryError is thrown you can be sure that not enough memory is available to your program, i.e. the GC couldn't clean up enough memory for another memory allocation; usually it's an error in your program or your program simply needs too much memory.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    vivek6569 is offline Member
    Join Date
    May 2011
    Location
    bangalore
    Posts
    4
    Rep Power
    0

Similar Threads

  1. JVM Garbage Collection
    By daromnet in forum Advanced Java
    Replies: 4
    Last Post: 03-09-2011, 10:18 AM
  2. Garbage Collection Question
    By DrMath in forum New To Java
    Replies: 5
    Last Post: 10-03-2009, 10:08 AM
  3. Java Garbage Collection and destructors
    By riddhik84 in forum New To Java
    Replies: 1
    Last Post: 09-30-2009, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •