memory management - .net Garbage Collection and managed resources -


Once they leave the scope or add to the garbage collection, then primitive data types (intestine, four, etc.) ) For release later?

Consider:

  as integer = 0 to 1000 as the dim sum of y  

if it works Do not clean the garbage collector by adding 1000 integers later, how does this string behave? Will it make 1000 wire to clean later?

How about the structures in which only the int, string , Etc. ... data type?

Classes containing only managed resources?

OK, there are already two incorrect notifications with the same answer ...

  • String is not an initial type
  • No string value type
  • Value type values ​​ not are always built on steaks - this Depends on where the variable is, if it is part of a square, then it is stored on the heap with the rest of the data in that object.
  • Even the local variables can end up on a heap, if they are captured (for example, in benami functions and iterator blocks)
  • String literals such as "" inserted - they always solve the same string, this loop is not actually making any strings.

For more information, see my article. You may also want to consider.


Comments