Re: Re-read an image



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:


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"
<johnmarcov...@xxxxxxxxxxxxxxx>
wrote:
Since we were talking about memory allocation using malloc or
mxMalloc, I decided to run a few experiments using a few DLL's
I
had
laying around. They essentially read in large images and
downsample
them. No big deal. However, I noticed that if I read an image,
then
read it again, the second read is drastically faster. If
someone
can
explain why it is that subsequent reads are much faster than
the
first, I would be interested to know. But, more important to me
at
the moment, how can I force subsequent reads to be "clean",
that
is,
re-read from scratch? Doing a clear all does not help. I want
to
force Matlab to forget that it just read the image and
apparently
knows how.

Thanks,
John



.



Relevant Pages

  • Re: Caching control
    ... |> A feature that would be useful is one where the level of caching can be ... The problem it solves is to avoid flooding RAM with a large number of pages ... of data that are merely going to be written to disk. ...
    (comp.os.linux.development.system)
  • Computers of the Future
    ... AI to decide how to allocate CPU, RAM, DISK, Flash etc in a way the ... AI to place files on disk in the most optimal way. ... No more locking apps or data into a particular machine. ... use of computers as entertainment controllers to find HTDV ...
    (comp.lang.java.advocacy)
  • Re: Reginald Etc.
    ... This one caught my eye and I was going to buy the package, but they only had the version with less RAM in stock. ... Going to Vista doesn't get me all excited, but I really haven't tried it much and am only going by the industry reaction to it. ... I don't have the level of interest in computers to get into running software emulators and/or stocking up on new applications to do stuff. ... For backups you can buy and external USB disk or go with an on-line backup service. ...
    (rec.boats)
  • Re: Evaluating D2005, help needed.
    ... forced to upgrade your RAM to at least 1GB to get satisfactory productivity levels, otherwise things will be caching out to disk much too often. ...
    (borland.public.delphi.non-technical)
  • Re: Re-read an image
    ... MATLAB is not caching the data. ... play but honestly don't understand computers at that level. ... it's most likely not in ram memory. ... of sectors around your image, not just your exact image bytes. ...
    (comp.soft-sys.matlab)