Working set increases

F

Fritz

Environment: Windows Server 2003 EE, .Net Framework 1.1, C#

I have a problem of memory usage growing continuously.
Basically, my application is a windows service that polls a webservice
method. This method returns a string array which is normally empty, and no
action is performed. Every 30 secs (polling time) the memory usage raises of
few KB.

Do you have any idea about what can cause this working set increment?

I report here the code of the timer event handler for who feels like having
a look.


// Timer.Elapsed event handler
public static void OnTimedEvent(object source, ElapsedEventArgs e)
{
timer.Enabled=false;
IniData ini=IniData.Instance(); // initialization class (singleton)
Logger log=Logger.Instance(); // log class (singleton)
try
{
WebService jgpm=new WebService(); // The web service is secured by using
https and certificates
X509Certificate x509 =
X509Certificate.CreateFromCertFile(ini.getCerFileName());
jgpm.ClientCertificates.Add(x509);
jgpm.Url=ini.getWsUrlRoot()";
string s=x509.GetName();

string[] tickets=jgpm.getOrders(s); // WEB SERVICE METHOD

foreach (string ticket in tickets) // tickets is normally empty and the
statement is not executed
{
// ticket elaboration
}
}
catch (Exception exc)
{
log.Debug(exc.Message);
}
timer.Enabled=true;
}
 
G

Guest

The string array may well be the problem. Try setting it to null when it is no longer needed. The memory usage would still rise but *eventually* the GC will do its round and the memory usage *should* :) reduce (not to familiar with the .net GC)

Rasika
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top