Oracle 5.0 Reference Manual page 1374

Table of Contents

Advertisement

• val: The new value.
command-delete(connid, key, exptime)
Fired for a
Arguments:
• connid: The connection ID.
• key: The requested key.
• exptime: The expiry time.
15.6.2.6. Memory Allocation within
When you first start memcached, the memory that you have configured is not automatically allocated.
Instead,
memcached
information into the cache.
When you start to store data into the cache,
on an item by item basis. Instead, a slab allocation is used to optimize memory usage and prevent
memory fragmentation when information expires from the cache.
With slab allocation, memory is reserved in blocks of 1MB. The slab is divided up into a number of
blocks of equal size. When you try to store a value into the cache,
value that you are adding to the cache and determines which slab contains the right size allocation for
the item. If a slab with the item size already exists, the item is written to the block within the slab.
If the new item is bigger than the size of any existing blocks, then a new slab is created, divided up into
blocks of a suitable size. If an existing slab with the right block size already exists, but there are no free
blocks, a new slab is created. If you update an existing item with data that is larger than the existing
block allocation for that key, then the key is re-allocated into a suitable slab.
For example, the default size for the smallest block is 88 bytes (40 bytes of value, and the default 48
bytes for the key and flag data). If the size of the first item you store into the cache is less than 40
bytes, then a slab with a block size of 88 bytes is created and the value stored.
If the size of the data that you intend to store is larger than this value, then the block size is increased
by the chunk size factor until a block size large enough to hold the value is determined. The block size
is always a function of the scale factor, rounded up to a block size which is exactly divisible into the
chunk size.
For a sample of the structure, see
Figure 15.7. Memory Allocation in
The result is that you have multiple pages allocated within the range of memory allocated to
memcached. Each page is 1MB in size (by default), and is split into a different number of chunks,
according to the chunk size required to store the key/value pairs. Each instance has multiple pages
command.
delete
memcached
only starts allocating and reserving physical memory once you start saving
Figure 15.7, "Memory Allocation in
Using
memcached
does not allocate the memory for the data
memcached
memcached
1354
checks the size of the
memcached
memcached".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents