aspose file tools
The moose likes Beginning Java and the fly likes byte array and garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "byte array and garbage collection" Watch "byte array and garbage collection" New topic
Author

byte array and garbage collection

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 757

My program spawns many threads. Each thread will allocate a byte array of size 100,000. Do I need to null the array within each worker thread as they are about to die ?
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

An object becomes eligible for garbage collection when there is no live thread that holds a reference to the object.

Setting variables to null in a thread that's going to stop immediately after that doesn't help anything for garbage collection.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: byte array and garbage collection
 
Similar Threads
unable to read file header
How to convert RAW(32) to String?
byte array to String
split text file into bytesize chunks!
db access returning String