Solved

Memory Leak

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.

705 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

18 Experts available now in Live!

Get 1:1 Help Now