« Return to Thread: Memory leaks - what causes them?

Re: Memory leaks - what causes them?

by David Norwood-3 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Your leak appears every ten minutes, so I would look for code that runs on that schedule.  Are you running the weather graphing script?  If so, you should comment out the line in the script that generates the graphs (that should probably be a trigger), and see if that solves it.  Otherwise, try disabling each of your scripts for ten minutes.  It shouldn't take too long to find the cause.   
 
If your "my" variable declaration is by itself outside of an "if" clause, subroutine, etc, it will be pulled out of the main loop.  And I think perl handles the case of a "my" declaration inside an "if" clause, subroutine, etc correctly.  
 
To tell you the truth, I've seen this question asked many times but never seen an example of code that causes a memory leak in misterhouse.  This would make a great wiki article if anyone ever figured out some common causes. 
 
David
 
----- Original Message -----
From: chris@...
To: misterhouse-users@...
Sent: Friday, February 06, 2009 3:33 AM
Subject: [mh] Memory leaks - what causes them?

I have a leak that’s costing me about 3Mb/hr.

 

Fri 06/02/09 21:00:00  37.9 hours:   0.5 MB in  0.2 hours.  168.1 -> 168.6 at  3.02 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 21:10:00  38.1 hours:   0.5 MB in  0.2 hours.  168.6 -> 169.1 at  3.05 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 21:20:00  38.3 hours:   0.5 MB in  0.2 hours.  169.1 -> 169.6 at  3.02 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 21:30:00  38.4 hours:   0.5 MB in  0.2 hours.  169.6 -> 170.1 at  3.02 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 21:40:00  38.6 hours:   0.5 MB in  0.2 hours.  170.1 -> 170.6 at  3.07 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 21:50:00  38.8 hours:   0.5 MB in  0.2 hours.  170.6 -> 171.1 at  3.02 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 22:00:00  38.9 hours:   0.5 MB in  0.2 hours.  171.1 -> 171.6 at  3.02 MB/hour.  Total:  3.11 MB/hour

Fri 06/02/09 22:10:00  39.1 hours:   1.3 MB in  0.2 hours.  171.6 -> 172.9 at  7.68 MB/hour.  Total:  3.13 MB/hour

 

I have a couple of custom user code “modules” so I’m presuming that it’s in one (or more) of those.

 

What sorts of coding practices lead to memory leaks within MH?  Does, for example, the use of “my($var) = …” within a loop cause a leak?

 

 


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com


________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

 « Return to Thread: Memory leaks - what causes them?