Re: Re-read an image
- From: "John Marcovici" <johnmarcovici@xxxxxxxxxxxxxxx>
- Date: Tue, 3 Apr 2007 09:15:44 -0400
Thanks for explainer. I suspected something to do with caching was at
play but honestly don't understand computers at that level. Now how
can I clear out that cache <==> make Matlab forget about the
image it just read?
ImageAnalyst wrote:
<johnmarcov...@xxxxxxxxxxxxxxx>
This is normal and happens all the time, even when loading programs
and other data. Have you ever heard of disk caching? The first
time
you read that image, it's most likely not in ram memory. Then it
must
go to the drive and read it off the disk - it actually reads a
bunch
of sectors around your image, not just your exact image bytes. The
memory off the disk platter then gets sent to the CPU but a copy of
the sectors gets stored in ram (I'm not certain where this ram is.
I
think it's on the drive but maybe in your computer/cpu). This is
so
that the next time you want it, it will be pulled from ram and not
have to read the disk - this will make it faster. They do this
because they noticed that often the next read a computer wants to
do
happens to come from the sectors of the disk right near where the
last
read was, so they might as well just store it in ram. If they were
right, it's faster, if they were wrong, well it's just the same as
it
would be with no caching.
Regards,
ImageAnalyst
On Apr 3, 2:22 am, "John Marcovici"
wrote:I
Since we were talking about memory allocation using malloc or
mxMalloc, I decided to run a few experiments using a few DLL's
hadsomeone
laying around. They essentially read in large images anddownsample
them. No big deal. However, I noticed that if I read an image,then
read it again, the second read is drastically faster. If
canthe
explain why it is that subsequent reads are much faster than
thatfirst, I would be interested to know. But, more important to meat
the moment, how can I force subsequent reads to be "clean",
is,to
re-read from scratch? Doing a clear all does not help. I want
apparentlyforce Matlab to forget that it just read the image and
.knows how.
Thanks,
John
- Follow-Ups:
- Re: Re-read an image
- From: ImageAnalyst
- Re: Re-read an image
- From: John Marcovici
- Re: Re-read an image
- References:
- Re-read an image "clean"
- From: John Marcovici
- Re: Re-read an image "clean"
- From: ImageAnalyst
- Re-read an image "clean"
- Prev by Date: Re: help input plus-minus sign in photoshop
- Next by Date: Re: R2007a on MacoSX Intel does not start
- Previous by thread: Re: Re-read an image "clean"
- Next by thread: Re: Re-read an image
- Index(es):
Relevant Pages
|