in reply to Out of memory using chart::clicker
I think that the long answer and the short answer are both that Chart::Clicker is leaking memory. Maybe not leaking in its own code, but somewhere between the primary module and its dependencies, there's a leak. I don't see in your code anything that you are doing seriously wrong. When you pass to an object's constructor a reference to an array, and later let that object fall out of scope, whether or not the array is still in scope should never affect the object's ability to be destroyed, freeing up its memory. My first suspicion was that the ref to the array was somehow being tied inside the object to a class that created a circular reference. But I don't see any use of tie; just a lot of Moose. However, the dependency chain is fairly heavy, and I didn't work my way up the chain in every direction in my effort to track down the culprit.
If it were me, I would try to boil it down to an even smaller test case that demonstrates the leak, and submit it as a bug report via Chart::Clicker's RT. The author knows his code base and dependencies better than you. Certainly authors appreciate actionable reports -- ones where you've done the research and created a patch for them. And if you have the ambition to do that, I'm sure it would be welcomed. But at minimum, at least submit a report demonstrating the bad behavior.
As for a temporary fix: The time honored solution is to fork children, work work work, then let them report back, and ultimately each one exits. By instantiating your Chart::Clicker objects inside of short-lived child processes, you never get into a situation where a memory leak in Chart::Clicker has a long enough life to become a problem. It's an ugly truth, but it works.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Out of memory using chart::clicker
by sn1987a (Curate) on Feb 21, 2014 at 19:18 UTC | |
by BorisPlus (Initiate) on Feb 22, 2014 at 20:50 UTC | |
by Peterpion (Acolyte) on Feb 23, 2014 at 11:17 UTC | |
by Peterpion (Acolyte) on Feb 24, 2014 at 10:56 UTC | |
by BorisPlus (Initiate) on Feb 24, 2014 at 19:59 UTC |