Solved

Memory Leak

Posted on 2010-11-25
4
418 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Let’s list some of the technologies that enable smooth teleworking. 
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

820 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