PC Review


Reply
Thread Tools Rate Thread

array allocation and garbage collection

 
 
Jon
Guest
Posts: n/a
 
      17th Jan 2008
If I allocate an array, eg:

double[] x = new double[10000];

then use the array, then at some later point, allocate it again, eg:

double[] x = new double[15000];

does the garbage collector know that the memory allocated the first time round can be garbage
collected, or do I have to set x to null first before allocating the second time around?


 
Reply With Quote
 
 
 
 
Jon
Guest
Posts: n/a
 
      17th Jan 2008
Sorry, this was meant for the C# forum.


"Jon" <.> wrote in message news:(E-Mail Removed)...
If I allocate an array, eg:

double[] x = new double[10000];

then use the array, then at some later point, allocate it again, eg:

double[] x = new double[15000];

does the garbage collector know that the memory allocated the first time round can be garbage
collected, or do I have to set x to null first before allocating the second time around?



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array allocation and garbage collection Jon Microsoft C# .NET 7 18th Jan 2008 01:00 PM
garbage collection Mike J Microsoft VB .NET 3 11th May 2007 07:19 PM
70-217 Garbage Collection Preacher Man Microsoft Windows 2000 Active Directory 2 2nd May 2005 09:55 PM
Garbage collection Gary Microsoft VB .NET 6 23rd Nov 2003 01:33 PM
Garbage collection Ralph Microsoft Windows 2000 Active Directory 5 12th Sep 2003 09:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.