GC
-
WIll GC only fress memory if there are other apps which needs more memory. If there is enough free space it will not free memory. Is it right.
Gosh - didn't I just answer this ? In my experience, GC can be slow to occur if you don't force it, and yes, the thing that forces GC is the fact that your computer has no memory options left at all. Or you can force it yourself. This is a bad idea, you should just manage the items that you think can cause a problem. Basically, if you deal with large objects like bitmaps, you need to manage your own memory, just like you did in C++. Christian Graus - Microsoft MVP - C++
-
Gosh - didn't I just answer this ? In my experience, GC can be slow to occur if you don't force it, and yes, the thing that forces GC is the fact that your computer has no memory options left at all. Or you can force it yourself. This is a bad idea, you should just manage the items that you think can cause a problem. Basically, if you deal with large objects like bitmaps, you need to manage your own memory, just like you did in C++. Christian Graus - Microsoft MVP - C++
-
Yes, if you must. I would not recommend it though, you could hurt performance by causing the GC to run more often than it should. Just dispose of objects that you'd like collected. Christian Graus - Microsoft MVP - C++
-
Yes, if you must. I would not recommend it though, you could hurt performance by causing the GC to run more often than it should. Just dispose of objects that you'd like collected. Christian Graus - Microsoft MVP - C++
-
WIll GC only fress memory if there are other apps which needs more memory. If there is enough free space it will not free memory. Is it right.
The GC runs on it's own internally managed schedule, not necessarily only when memory starts to run low. Other factors also influence when the GC occurs. If you release lots of small objects all over the managed heap, the GC will run earlier than scheduled so it can compact the memory to make room for larger objects and/or prevent memory fragmentation. This is only one small sample of how the GC manages memory collection. If you really want to learn the in's and out's about how the Framework manages memory, object creation/destruction, object lifetimes, how unmanged memory fits into scheme of managed memory, ..., check out this[^] article index on MSDN. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
WIll GC only fress memory if there are other apps which needs more memory. If there is enough free space it will not free memory. Is it right.
-
As an aside I have found I can make much memory savings by reusing objects. Performance can go through the roof when doing that as well - or at least it did with me.