Memory used with long use....

Bug #85502 reported by encompass
4
Affects Status Importance Assigned to Milestone
PHImage
Fix Released
High
Pete Savage

Bug Description

I noticed the my system slow eats it memory up as the program runs. It only happens with long use, around 10minute.
I have a folder called "Get-to-gether" with 69 jpg images... most are around 450X450 resolution and 95 percent of them were resized with f-spot's export to folder.
If you need to check things yourself feel free to contact me and I can let you ssh in.

Revision history for this message
encompass (encompass) wrote :

This is a screen shot of the memory usage just after killing it when it started to stall out and use my swap.
With a gig of ram I can go quite a while... but not too long with out filling my mem.

Revision history for this message
Pete Savage (petesavage) wrote :

Have checked this out and confirmed it. I will look into this as a matter or urgency. This shouldn't be happening at all. I can't think off hand why it is happening. Thank you for this bug.

Changed in phimage:
assignee: nobody → petesavage
importance: Undecided → Critical
status: Unconfirmed → Confirmed
importance: Critical → High
Revision history for this message
Pete Savage (petesavage) wrote :

Looking today, I've not found out where the leak is coming from only, that it exists. Increasing the hang time and blend time makes the problem less relevant, in fact I managed to get the problem to be almost non-existent. I used pysizer to try to find the leak, but it's very difficult to see it. I can see a general trend of increase but can't pinpoint it at the moment. Will try again later.

Revision history for this message
encompass (encompass) wrote :

Here is another picture.. I changed the settings to run blendtime and displaytime both at 1.
This sped up the error and we could see an interesting correlation between memory and run usage. Notice as the memory is climbing the processor spikes up and down erratically and the memory climbs at the same rate the whole time. (Mind you, most of my images are around the same size.) But here is the interesting part. Notice the drop for just a moment as the rise occurs? Weird huh? Wonder what that is. I will continue to play with settings to weed out the leak.

Revision history for this message
Pete Savage (petesavage) wrote : Re: [Bug 85502] Re: Memory used with long use....

I believe what you are seeing is the loading of the next image. The
drop in memory, if that's where it is happening, my pocket pc won't
let me see the image, is probably due to the pix buffers being reset
in the textureloader class. The cpu spike is indicative of the image
resize operation. All images must be resized to, 512,512 or tilesize
if set, in order to display in opengl. But you have given me an idea
thanks.

--
Pete Savage - cbx33::silentk
wiki.ubuntu.com/PeteSavage

Revision history for this message
Pete Savage (petesavage) wrote :

This is odd, I was running with silly figures for hangtime and blendtime, 10 and 10.

Notice the significant drop?

Revision history for this message
Pete Savage (petesavage) wrote :

Check this out

Revision history for this message
Pete Savage (petesavage) wrote :

This has been fixed now. Quoting from the pygtk FAQ

"Apparently finalizers are not necessarily called as soon as an object goes out of scope. My guess is that the python memory manager doesn't directly know about the storage allocated for the image buffer (since it's allocated by the gdk) and that it therefore doesn't know how fast memory is being consumed. The solution is to call gc.collect() at some appropriate place."

So I made a few changes to the way it runs and voila, memory bug solved ;)

Thanks Jason for pointing this one out. Nice that we caught it early on. I was beginning to think phimage was doomed.

Changed in phimage:
status: Confirmed → Fix Committed
Pete Savage (petesavage)
Changed in phimage:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.