Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

New / Delete  RSS feed

 
Jonathan Andrew King
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I know that Java does not have a delete for object removal and that the GC deals with the freeing of memory. I understand that the GC was devised to compensate for the fact that the JVM can't trust developers to free unused objects.
My question is this:
Can't a two tier system be implemented to allow developers to delete unwanted objects, leaving the GC to clear up the mess ?
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you can interact (limited) with the GC using the ReferenceObject API.
also you can schedule garbage collection by calling gc() (in System). but this does not ensure execution of colleciton. and you can setting the references to null as soon as you dont use them anymore.
i guess thats about it how you can interact with GC.
hope that helps
karl
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!