When does Java's garbage collection free a memory allocation?

Viewed 11394

I have created an object in Java, Named FOO. FOO contains a large amount of data.. I don't know say for a ten mega byte text file that I have pulled into ram for manipulation.(This is just an example)

This is clearly a huge amount of space and I want to deallocate it from memory. I set FOO to NULL.

Will this free up that space in memory automatically? or Will the memory taken by the loaded text file be around until automatic garbage collection?

6 Answers
Related