The default configuration of Enblend and Enfuse assumes a system with
3--4@dmn{GB} of @acronym{RAM}.

@cindex image cache
If Enblend and Enfuse have been compiled with the ``image-cache''
feature, they do not rely on the operating system's memory management,
but use their own image cache in the file system.  To find out whether
your version uses the image cache say

@example
enblend --verbose --version
@end example

@noindent
or

@example
enfuse --verbose --version
@end example

@noindent
@cindex image cache, location
@cindex @env{TMPDIR}
Enblend and Enfuse put the file that holds the image cache either in
the directory pointed to by the environment
variable@tie{}@env{TMPDIR}, or, if the variable is not set, in
directory@tie{}@file{/tmp}.  It is prudent to ensure write permissions
and enough of free space on the volume with the cache file.

@opindex -m
@opindex -b
The size of the image cache is user configurable with the
option@tie{}@samp{-m @var{CACHE-SIZE}} (@pxref{Extended Options}).
Furthermore, option@tie{}@samp{-b @var{BUFFER-SIZE}} (@pxref{Extended
Options}) allows for fine-tuning the size of a single buffer inside
the image cache.  Note that @var{CACHE-SIZE} is given in megabytes,
whereas the unit of @var{BUFFER-SIZE} is kilobytes.

Usually the user lets the operating system take care of the memory
management of all processes.  However, users of Enblend or Enfuse
might want to control the balance between the operating systems'
@uref{http://@/en.wikipedia.org/@/wiki/@/Virtual_@/memory, Virtual
Memory} system and the image cache for several reasons.

@itemize
@item
Paging in or out parts of a process' image runs at kernel level and
thus can make user processes appear unresponsive or ``jumpy''.  The
caching mechanism of Enblend and Enfuse of course runs as a user
process, which is why it has less detrimental effects on the system's
overall responsiveness.

@item
The image cache has been optimized for accesses to image data.  All
algorithms in Enblend and Enfuse have been carefully arranged to play
nice with the image cache.  An operating system's cache has no
knowledge of these particular memory access patterns.

@item
The disk access of the operating system to the swap device has been
highly optimized.  Enblend and Enfuse on the other hand use the
standard @acronym{IO}-layer, which is a much slower interface.

@item
Limiting the amount of image cache prevents Enblend and Enfuse from
eating up most or all @acronym{RAM}, thereby forcing all user
applications into the swap.
@end itemize

@noindent
The @var{CACHE-SIZE} should be set in such a way as to reconcile all
of the above aspects even for the biggest data sets, that is, projects
with many large images.

@ref{Table:cache-size-settings} suggests some cache- and buffer-sizes
for different amounts of available @acronym{RAM}.

@float Table,Table:cache-size-settings
@ifinfo
@example
 @acronym{RAM}  | @var{CACHE-SIZE} | @var{BUFFER-SIZE} | Comment
 MB   |     MB     |     KB      |
------+------------+-------------+---------
 4096 | 1024       | 2048        | default
 2048 | 512--1024  | 1024        |
 1024 | 256--512   | 256--512    |
@end example
@end ifinfo
@html
<table border="1">
    <tr>
        <th>RAM</th>
        <th><i>CACHE-SIZE</i></th>
        <th><i>BUFFER-SIZE</i></th>
        <th>Comment</th>
    </tr>
    <tr>
        <th>MB</th>
        <th>MB</th>
        <th>KB</th>
        <th></th>
    </tr>
    <tr>
        <td>4096</td>
        <td>1024</td>
        <td>2048</td>
        <td>default</td>
    </tr>
    <tr>
        <td>2048</td>
        <td>512&ndash;1024</td>
        <td>1024</td>
        <td></td>
    </tr>
    <tr>
        <td>1024</td>
        <td>256&ndash;512</td>
        <td>256&ndash;512</td>
        <td></td>
    </tr>
</table>
@end html
@tex
{
    \vskip0.5\baselineskip
    \offinterlineskip
    \halign{
        \indent\strut\hfil#\hfil&
        \quad\vrule#&
        \quad\hfil#\hfil&
        \quad\vrule#&
        \quad\hfil#\hfil&
        \quad\vrule#&
        \quad#\hfil\cr
        \bf RAM && \bf CACHE-SIZE && \bf BUFFER-SIZE && \bf Comment \cr
        \bf MB  && \bf MB         && \bf KB          && \cr\noalign{\hrule}
        \omit   &\vrule height.667ex width0pt& \omit          && \omit           && \cr
        4096    && 1024           && 2048            && default \cr
        2048    && 512--1024      && 1024            && \cr
        1024    && 256--512       && 256--512        && \cr
    }
}
@end tex
@docbook
<table>
    <title>Suggested cache-size settings</title>
    <tgroup cols="4">
        <thead>
            <row>
                <entry>RAM</entry>
                <entry><varname>CACHE-SIZE</varname></entry>
                <entry><varname>BUFFER-SIZE</varname></entry>
                <entry>Comment</entry>
            </row>
            <row>
                <entry>MB</entry>
                <entry>MB</entry>
                <entry>KB</entry>
                <entry></entry>
            </row>
        </thead>
        <tbody>
            <row>
                <entry>4096</entry>
                <entry>1024</entry>
                <entry>2048</entry>
                <entry>default</entry>
            </row>
            <row>
                <entry>2048</entry>
                <entry>512&ndash;1024</entry>
                <entry>1024</entry>
                <entry></entry>
            </row>
            <row>
                <entry>1024</entry>
                <entry>256&ndash;512</entry>
                <entry>256&ndash;512</entry>
                <entry></entry>
            </row>
        </tbody>
    </tgroup>
</table>
@end docbook
@caption{Suggested cache-size settings}
@c @shortcaption{}
@end float

On systems with considerably more than 4@dmn{GB} of @acronym{RAM} it
is recommended to run Enblend or Enfuse versions without image cache.
