On Tuesday 01 Feb 2005 19:49, Mark Purcell wrote:

> On Sun, Jan 30, 2005 at 12:06:01AM +0000, Richard Lamont wrote:

> > I started it again and looked at what was happening with top, and
> > found that digikam was reserving memory of the same order of
> > magnitude as the total size of the files downloaded. (After
> > downloading about 130 pictures it had hogged about an extra 100 MB
> > of RAM.) Closing the camera window freed the memory.
>
> I don't know if I would call this a memory leak as it does free the
> memory after it has finished with it. A memory leak wouldn't retun
> the allocated memory.
>
> That said I can confirm the behaviour as I just uploaded over 100
> pictures from a full 256Mb card and digikam ended up reserving over
> 250Mb of main memory. That said my machine didn't thrash and was
> still responding well.

OK, so the 'memory leak' is a feature not a bug. :-)

> Perhaps this is a design issue and as has been pointed out gphoto
> keeps all photo's in memory as a matter of course.

Indeed. However if it causes users' machines to lock up then it's bad 
design and needs to be changed. It's a simple as that.

What is the point of the app cacheing the files that have been 
downloaded from the camera to disc, when the linux kernel uses spare 
RAM for disc cacheing anyway? Isn't it just adding a redundant layer of 
bloat that wastes memory and slows everything down? (I'm not sure how 
the BSD kernels behave.)

> Can you try switching off other Linux processes and see if you
> machine still starts to thrash.  Then again if your machine is trying
> to swap 1Gb of photo's with only 512Mb then perhaps you should also
> 'invest' in some disk swap space to make your memory footprint over
> the 1Gb.

Shutting down other apps helps in that it frees up some memory, but this 
only makes a marginal difference.

1GB flash cards are becoming commonplace nowadays, whereas 1GB RAM in a 
PC is still relatively rare.

I could add some swap, but once the machine starts doing a lot of 
swapping it will thrash horribly anyway. That's why I replaced the swap 
I had with an equivalent amount of RAM. To date, in the two years I 
have had this machine, 512MB has been ample - even for video editing, 
and the absence of swap has never been an issue.

libgphoto2's memory usage is broken by design. It seems the upstream 
authors understand this, because this bug has been assigned a high 
priority on their bug tracker page. In fact there's already a patch 
there, although I'm not sure how official it is.

http://sourceforge.net/tracker/index.php?func=detail&aid=1098166&group_id=8874&atid=108874


-- 
Richard Lamont
<[EMAIL PROTECTED]>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to