Note that there are some explanatory texts on larger screens.

plurals
  1. POTimers eating memory (3MB for second)
    primarykey
    data
    text
    <p>I have application written on c# and which uses few timers (4 Timers).The application request responses from web service by relevant time intervals.if internet is connected application use 12-15 Mb of memory but when internet is disconnected application increasing memory usage (3MB per second).</p> <p>I force run garbage collector but no improvement. when internet is disconnects occurs some exceptions but all of them are properly handled.</p> <p>this is part of my code if internet is disconnectd and when calling shn.show*Details() methods increases memory usage GetXML.GetResponce () does that call webservice on paramitter and return reply xml as string, ParseXML class does above returned xml respnce parse and convert it to a object</p> <pre><code>class Scheduler { private System.Windows.Forms.Timer dataTimer; private System.Windows.Forms.Timer promoTimer; private showNotifications shn; public Scheduler() { dataTimer = new System.Windows.Forms.Timer(); promoTimer = new System.Windows.Forms.Timer(); shn = new showNotifications(); } public void scheduleDmsg(int time) { if (time &lt; 1) { time = 5; } dataTimer.Interval = time * 60000; dataTimer.Tick += new EventHandler(InitDmsg); dataTimer.Enabled = true; } public void schedulePmsg(int time) { if (time &lt; 1) { time = 5; } promoTimer.Interval = time * 60000; promoTimer.Tick += new EventHandler(InitPmsg); promoTimer.Enabled = true; } private void InitDmsg(Object source, EventArgs e) { try { //--------------------at the start of app------------------ showNotifications shn = new showNotifications(); HandleUserData hud = new HandleUserData(); Userinfo uin = hud.ReadUserData(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.InnerXml = GetXML.GetResponse(new Uri("auth service url"));// this web service use to authenticate user by ip address Auth authDetails = ParseXML.ParseAuth(xmlDoc); try { if (authDetails.SUB.Equals("no_entry")) // if authenicated no_entry become &gt;&gt; &lt;11 digit number&gt; { } else { //if authenticated xmlDoc.InnerXml = GetXML.GetResponse(new Uri("info url")); Pre preDetails = ParseXML.ParsePre(xmlDoc); switch (preDetails.SUB_TYPE) { case "1": shn.showPreDetails(); //showPreDetails method display some information on cusom notification message break; case "2": shn.showPostDetails();//showPostDetails method display some information on cusom notification message break; case "3": shn.showPreDetails(); break; case "4": shn.showPreDetails(); break; case "5": shn.showPostDetails(); break; default: break; } } } catch (Exception ex) { //MessageBox.Show("Error Occured"); } } catch (Exception ex) { } } private void InitPmsg(Object source, EventArgs e) { //shn.showPromoMsgs(); showNotifications.showPromoMsgs(); ////showPromoDetails method display some information on cusom notification message } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload