Solved

Memory Leak

Posted on 2010-11-25
4
413 Views
Last Modified: 2013-11-15
I am running a Catalyst application using Perl on Cygwin on Windows 2003. After a period of time (say 24 hours), the perl.exe process runs out of memory and crashes. I have identified some small leaks (likely due to circular references in the underlying code) by using Catalyst::Controller::LeakTracker. However the amount of memory being leaked far exceeds these small leaks.

Any ideas, tips thoughts would be appreciated
0
Comment
Question by:aleksgrid
4 Comments
 
LVL 8

Accepted Solution

by:
wolfgang_93 earned 250 total points
ID: 34219682
I believe a circular reference that infinitely calls itself would eventually use up your memory and
crash -- no matter how minor it is.

I would put in a few print statements before a call to a procedure along with the values
of arguments and write to a log file.

Then I would run the application for a few minutes, then use task center to kill it.

Then I would look at the log file to see what is apparently called infiinitely. The argument
values displayed in the output will give a good clue as to why something is called
infinitely.
0
 
LVL 4

Assisted Solution

by:kyanwan
kyanwan earned 250 total points
ID: 37198761
Catalyst is a huge project with major support, so I would instinctively lean away from the problem being with the package.

To me, It sounds like a slow leak - as in huge amount of unreleased memory, such as a dynamic data structure getting out of control ( ex: a huge hash, globally declared instead of local, using dynamic data where it keeps putting more elements till it pops. )

1 - To ensure it's not Catalyst, ensure you're using a recent release.

2 - Analyze the code that's calling Catalyst.  Locate any calls to external data, any I/O by the code.  Ensure all release-able variables are released ( eg: declared "my" ) ; Avoid calling variables outside of blocks...

3 - Check any hashes in-use, big arrays, file calls, potentially large database calls, etc....
0
 
LVL 9

Expert Comment

by:Suhas .
ID: 37436313
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now