Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Needs help in garbage collection

    How to handle garbage collection in java? Thanks

  2. #2
    Join Date
    Jul 2013
    Posts
    1
    read headfirst book ,you will find a lot of info there pokie games
    Last edited by Iancastro; 07-16-13 at 07:22.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    12,569
    in short y'don't
    once the last reference to that object is broken the garbage collector will, when it needs to or can do will clear up after you.
    so providing you dereference the object as soon as that portion of code has ceased using the object garbage collection should happen

    you requet the JVM to do a garbage collection through Runtime.gc() but all that does is suggest to the JVM that it should do a garbage collection.

    if you find you NEED to run the collector then it may be a design issue with your code, especially if you are doing a lot of string manipulation
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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