This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

byte array and garbage collection

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic