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

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

How to handle garbage collection in java? Thanks
Reply With Quote
  #2 (permalink)  
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)  
Jaded Developer
Join Date: Nov 2004
Location: out on a limb
Posts: 12,296
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
Is taking part in the 'Distinguished Gentlemans' ride. Being neither distinguished nor a gentleman, but I am keen to raise funds for Prostrate Cancer research. At present I'm threatening to ride a Norton 961 wearing a kilt. If you would like to contribute to Prostrate Cancer research then please consider donating via this page:-
Reply With Quote

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