Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.OutOfMemoryException and IDisposable
Message
De
13/12/2011 04:06:58
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
System.OutOfMemoryException and IDisposable
Versions des environnements
Environment:
VB 8.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MySQL
Divers
Thread ID:
01530931
Message ID:
01530931
Vues:
115
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;
    }
}
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform