Click to See Complete Forum and Search --> : Memory Usage


akkad
01-09-2007, 08:59 AM
Hi, i have a C# class that act as a buffer and it holds a large data,
so am looking for a way to directly remove the class instance
from the memory without waiting the garbage collector and even
without the "using block" that is used for critical code cuz
in my case i cannot assemble the code in one block, even i read
that it is not recommended to use "Dispose" method.

any idea??

scottrickman
01-09-2007, 11:18 AM
You can call the garbage collector from code rather than waiting for it. Implement the IDisposable interface in your class (there's a good tutorial http://www.codeproject.com/csharp/gcresdealloc.asp).