Memo Files (ADM)

Advantage Concepts

Advantage stores data for memo fields in a proprietary ADM memo file format. ADM memo files have a default storage block size of 8 bytes. The block size is configurable to allow you to define block sizes more adequately suited to your application, although it is not recommended to use a larger block size than the default unless you are consistently storing large amounts of data in each memo, binary, or image field. There is no performance benefit or memory (RAM) savings using a non-default memo block size, but disk space can be wasted if using a larger memo block size when not necessary. Therefore, using the default memo block size is usually recommended. If large amounts of data are stored in most memo/binary/image fields or memo/binary/image fields are consistently being updated with larger and larger amounts of data, a larger memo block size should be considered.

Valid memo block sizes are in the range 8-1024. When using the default memo block size of 8, if anywhere from 1 to 8 bytes of memo data is stored, a single 8-byte block in the memo file will contain the data. If 9 to 16 bytes of data are stored, two consecutive 8-byte blocks in the memo file will contain the data. Due to its smaller storage block size, ADM memo files are much more efficient at memo data storage than are Xbase memo files. The length of the memo data is stored in the memo field in the ADT record. Retrieval of ADM memo data is more than twice as fast as retrieval of Xbase memo data.

ADM memo files keep a "free block" list in its header. This list indicates which blocks within the file have been freed. An abandoned block will be reused before adding a new block to the bottom of the ADM file. Versions 7.1 and greater of the Advantage servers use improved memo space reuse algorithms that can greatly reduce memo file size, which can also result in better performance. Newly created tables will use the enhanced algorithms. Existing tables (created with versions 7.0 and earlier) will use the new algorithms after they have been packed or zapped (emptied).

ADM Memo Block Usage Example

If the word "Kayak" is stored in an ADM memo file, it will fit in a single 8-byte memo block. If the memo field information in that record is deleted, the 8-byte block in the memo file is not abandoned. It is added to the ADM "free list" to be used again. If an additional 600 characters are added to the memo field, the ADM memo file finds and uses 76 contiguous 8-byte memo blocks in the "free list" to store the new memo data.

See Also

Advantage Proprietary File Format Specifications