Is the memory from primitive data types (int, char,etc) immediately released once they leave scope, or added to garbage collection for later release?
consider:
For x as integer=0 to 1000 dim y as integer Next
If this doesn’t add 1000 integers to the garbage collector for clean up later, how does it treat string objects? would this create 1000 strings to clean up later?
For x as integer=0 to 1000 dim y as string='' Next
How about structures that contain only int,string,etc… data types?
Classes that contain only managed resources?
Okay, with only two answers there’s already misinformation…
For more info, see my article on what goes where in .NET memory. You might also want to consider whether it’s important or not.