Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System.OutOfMemoryException and IDisposable
Message
From
13/12/2011 04:06:58
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
System.OutOfMemoryException and IDisposable
Environment versions
Environment:
VB 8.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MySQL
Miscellaneous
Thread ID:
01530931
Message ID:
01530931
Views:
121
Hello All,

Every day the memory consumed getting bigger and bigger and in someday System.OutOfMemoryException thrown..
Does it because of the class has not been disposed ?

I am trying to implement IDisposable .. and I would appreciate if someone can give me suggestion or comment regarding on it..

please advise..

TIA
Winanjaya

Code in Cls1
object[] para = new object[] { para1, para2, para3 };
using (Cls1 cls1 = new Cls1())
{
    cls1.MainProc(para);
}
Code class Cls1 : IDisposable
{
    IntPtr _maxworkset = curProc.MaxWorkingSet;
    public void MainProc(object para)
    { 
      // DO SOMETHING HERE!
     }

    public void Dispose() 
    {    
        GC.SuppressFinalize(this);                  
        curProc.MaxWorkingSet = _maxworkset;
    }
}
Next
Reply
Map
View

Click here to load this message in the networking platform