Question Arrays, Memory and the GC

Jauch

New member
Joined
Apr 27, 2011
Messages
4
Programming Experience
5-10
I have a system that must do massive array operations.
Often I have many arrays with 1 to 2 million elements at same time.

Usually I create the arrays inside a procedure, so, I expect when the array variable goes out of scope, the array becomes available to the GC.
But in the near future, I'll need to do these operations in a "looping" way, so I'll create and delete the arrays many times...
.
Will GC free the memory associated to the arrays "in time" for the next loop or it is best to "force" it in someway, like using the erase statement?
.
Or maybe I'm completely wrong?
.
Thanks for any help with the clarification of this :)
 

ss7thirty

Well-known member
Joined
Jun 14, 2005
Messages
455
Location
New Jersey, US
Programming Experience
5-10
You should not have to worry about any of this .NET cleans this up as it is needed. One of the Mods may have a more detailed explanation or a better answer but I do not think you will have to worry about this. I have never had this issue in .NET and have performed similar operations with very massive hashtables,collections, and 2 dimensional arrays.
 
Top Bottom