File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Release of objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Release of objects" Watch "Release of objects" New topic

Release of objects

Aravind JAI

Joined: Feb 06, 2006
Posts: 18
How to Release the used objects in java program
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
You don't. That is the job of the garbage collector.

Why do you ask?

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jaime M. Tovar
Ranch Hand

Joined: Mar 28, 2005
Posts: 133
When other objects do not reference an object any more it becomes a candidate for garbage collection.

She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

Assuming there are no remaining references to an object in memory, the garbage collector will "scope" it for removal.

Transferring this topic to the Beginner forum.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
I agree. Here's the link:
subject: Release of objects
It's not a secret anymore!