| 1 |
<head> |
| 2 |
<title>AceDB cachesize.wrm syntax</title> |
| 3 |
|
| 4 |
<LINK rel=stylesheet type="text/css" |
| 5 |
href="../wdoc.css" |
| 6 |
title="Style sheet for wdoc documents"> |
| 7 |
|
| 8 |
</head> |
| 9 |
|
| 10 |
<body> |
| 11 |
<h2>AceDB cachesize.wrm syntax</h2> |
| 12 |
|
| 13 |
<p>This file indicates the size of the 2 caches</p> |
| 14 |
|
| 15 |
<p>It is read once during initialisation of the program, |
| 16 |
If this file is absent or cannot be read, the values |
| 17 |
defaults as indicated in the source code blocksubs.c |
| 18 |
i.e. 1000 and 1000 as of release 1-8</p> |
| 19 |
|
| 20 |
<p>Cache1 is an image of the disk |
| 21 |
It contains exactly CACHE1 blocks of size BLOC_SIZE |
| 22 |
defined as 1024 (as of 1-8) in disk_.h |
| 23 |
Very big objects are spread on several blocs but must be read |
| 24 |
in a single call, therefore CACHE1 must be big enough to |
| 25 |
accomodate the largest object (most probably Voc[_VText])</p> |
| 26 |
|
| 27 |
<p>Cache2 contains the develloped image of the B objects. |
| 28 |
It is handled as a shared memory between the various pieces of |
| 29 |
the code accessing the objects and keeps a count of the handles. |
| 30 |
If the total size of the of objects exceeds CACHE2, it will destroy the |
| 31 |
unreferenced ones. Hence, if you loop on bsCreate() and never |
| 32 |
bsDestroy, cache2 extends until you run out of memory. |
| 33 |
Even if CACHE2 is very small, the code will allways run, just |
| 34 |
much slower, since you will more often have to access cache1 |
| 35 |
and possibly the disk.,</p> |
| 36 |
|
| 37 |
<h3>Example</h3> |
| 38 |
|
| 39 |
<pre> |
| 40 |
CACHE1 = 4000 // Size of first cache, as used in w5/blocksubs.c |
| 41 |
CACHE2 = 4000 // Size of second cache, as used in w5/objcache.c |
| 42 |
DISK = 4000 // Initial size of database on disk at creation |
| 43 |
</pre> |
| 44 |
|
| 45 |
</body> |
| 46 |
</html> |