Nicole,
In Net does the value type "variable" not exist.
Although you can say that an object with a value in it is almost a variable.
(Don't try to use it that way we have seen in this newgroup often people
comming from VB6 who tried that, it has no benefits.)
An object is always on the managed heap.
When a value is not in an object it stays in the program stack
The GC is in charge to collect unused objects from the managed heap and
reclaiming memory from that.
When a value is in a method, than it is deleted from the stack as soon as
the method is done.
When the value is created as whatever global (static) value in a class it
stays as long as the class exists.
When a value or an object is in a shared procedure or a module, it lifes as
long as the application runs.
I hope this gives some ideas?
Cor
"Nicole" <Ni****@discussions.microsoft.com>
i'm reading some books on memory mgmt in .Net framework. And here is my
understanding: The memory for each object in .Net comes from managed heap.
The GC is in charge of collecting unused memory and reclaiming memory
automatically.
My questions is for value type variable, is the memory still from managed
heap ?
and what happens if the value type variable is not in use, such as
function
exits ?
Your explanation would be appreciated!