From: skaller <skaller@users.sourceforge.net>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: matt@gushee.net, caml-list@inria.fr
Subject: Re: [Caml-list] Weak hashtables & aggressive caching
Date: Tue, 15 Aug 2006 14:55:56 +1000 [thread overview]
Message-ID: <1155617756.29241.25.camel@rosella.wigram> (raw)
In-Reply-To: <20060815.062335.55488138.garrigue@math.nagoya-u.ac.jp>
On Tue, 2006-08-15 at 06:23 +0900, Jacques Garrigue wrote:
> From: Matt Gushee <matt@gushee.net>
>
> > I wrote a LablGTK-based image viewer this past weekend; one of its
> > features is an image cache--specifically, a weak hashtable that contains
> > values of type string * GdkPixbuf.pixbuf (the string being the file
> > name). When a particular image file is requested, it is retrieved from
> > the cache if it exists there; otherwise it is loaded from disk (and
> > placed in the cache at the same time). This is useful if the user wants
> > to quickly look back through a series of images that have already been
> > loaded, but it doesn't help with loading images for the first time.
>
> I wonder how you trigger the GC, to both keep the cache long enough,
> and to avoid filling the memory too much, and resulting in lots of
> swapping.
I'm confused. First, a pixmap doesn't have any pointers in it,
so it doesn't need to be scanned by the GC.
Second, you'd need a LOT of images to come even close
to running out of address space (on a 64 bit machine anyhow :)
And third, there would be no swapping, unless you were
flicking between the images .. in which case there'd
be swapping no matter what.
> Considering the difficulties avoid memory overflow,
I have thousands of images and I can scan them at full size
very fast with GQView .. I can only barely see the drawing
happen .. it almost keeps up with the keyboard repeat rate
at full screen size .. and that includes *scaling* the images.
Mind you .. GQView is extremely quick and it knows when to move on
(interrupts rendering when you tell it to view a new image).
(this is with a low end nVidia card on an amd64 3200 single core/1GRam)
Lets get real here: the difficulties arise editing video,
not still pictures.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
next prev parent reply other threads:[~2006-08-15 4:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-14 14:58 Matt Gushee
2006-08-14 15:47 ` [Caml-list] " Richard Jones
2006-08-14 16:28 ` Matt Gushee
[not found] ` <44E0A8F1.8060504@janestcapital.com>
2006-08-14 17:35 ` Matt Gushee
2006-08-14 18:18 ` Richard Jones
2006-08-14 23:25 ` Matt Gushee
2006-08-14 21:23 ` Jacques Garrigue
2006-08-14 23:30 ` Matt Gushee
2006-08-16 0:54 ` Jacques Garrigue
2006-08-16 4:33 ` Matt Gushee
2006-08-15 4:55 ` skaller [this message]
2006-08-15 16:17 ` Matt Gushee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1155617756.29241.25.camel@rosella.wigram \
--to=skaller@users.sourceforge.net \
--cc=caml-list@inria.fr \
--cc=garrigue@math.nagoya-u.ac.jp \
--cc=matt@gushee.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).