This is basically correct, except for terminology -- what Metakit does is
it uses memory mapped files. These files consume swap space as well as
real space on the disk. Most modern OSes have two levels of memory
mapping, committed and reserved: reserved means simply that an address
range is reserved and nothing else can be mapped into it, but the space is
not necessarily consumed yet -- that happens when the pages are committed.

Metakit attempts to map the entire file of an open database into memory,
so the reserved address range will grow with the size of the database. I
am not sure whether Metakit plays smart tricks with committed versus
reserved address ranges to optimize its use of address space.

In any case, the committed address space shows up as swap space usage (and
depending on the OS reserved ranges may also consume swap space, but I'm
not sure about that), and when RAM is available, modern OSes will attempt
to use that in preference to on-disk space. Metakit can memory-map files
of sizes that range up to the limits of available address space, and
access will cause page swapping at the OS level. This is generally a very
fast operation if you use Metakit as intended, by accessing rows in
increasing order -- that will make Metakit really "rip".

Summary - Metakit relies on OSes to be smart, and use memory mapping and
swap space, for speed. This achieves exactly the same effect as the page
swapping algorithms in more complex databases, except that it suffers from
the address space limitations of the 32-bit address space, whereas these
other DBs can do address translation as well, so there this limitation
would not hit. Metakit runs on 64-bit architectures and on these OSes the
address space limits do not pose an issue with current disk sizes.

--JYL

P.S. I am also not an expert and will readily admit when wrong :/

> Nemec,
>
> Meta kit is an "imbeded" database that archives speed and
> simplicity by not dealing with page swapping like a more complex
> database. Thus, the database is in memory when you are using it.
>
> PS. I'm not an expert so I could be wrong :/
> Tom K.
>
>> Hello,
>>
>> I am evaluating Metakit and have looked at the memory usage under
>> linux. I wrote a test program in C++ that adds batches of 5000 rows to
>> a view and commits after each batch, repeating this every few seconds.
>>
>> I noticed that the RAM usage of my test program grows linearly as more
>> rows are added.
>> What can I do to limit the RAM usage of such a program?
>>
>> Thanks,
>> Bernhard
>> _____________________________________________
>> Metakit mailing list  -  [EMAIL PROTECTED]
>> http://www.equi4.com/mailman/listinfo/metakit
>
> _____________________________________________
> Metakit mailing list  -  [EMAIL PROTECTED]
> http://www.equi4.com/mailman/listinfo/metakit



_____________________________________________
Metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to