If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Needs help in garbage collection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jul 2006
Posts: 153
Needs help in garbage collection

How to handle garbage collection in java? Thanks
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
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 06:22.
Reply With Quote
  #3 (permalink)  
Old
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 11,658
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On