Memory Management Glossary: W¶
- weak-key hash table
A hash table which has weak references(1) to its keys. If the key dies, the value for that key is automatically deleted from the table too. It can be used to store extra information about objects without keeping them alive.
In the MPS
- weak-value hash table
A hash table which has weak references(1) to its value. If the value dies, any keys that refer to that value are automatically deleted from the table too. It can be used to index a set of objects without keeping them alive.
In the MPS
- weak hash table
- A weak-key or weak-value hash table (usually the former).
- weak reference(1)
A weak reference does not keep the referent alive, but it will continue to refer to the object as long as it remains otherwise alive. When only weak references to the object remain, the weak references can be deleted (“splatted” or “cleared”) and the object reclaimed.
- weak reference(2)
Weak references form one of three kinds of weak reference(1) in Java. They are handy for associating extra data with objects when you cannot store it in the objects themselves.
- weak root
- weak tri-color invariant
weak tri-colour invariant
weak tricolor invariant
weak tricolour invariant
By preserving this property throughout tri-color marking, a tracing algorithm can ensure that the collector(2) will not miss reachable objects, even if the mutator manipulates the graph during the collection. Mutator actions might need to change the color of the nodes affected in order to preserve the invariant.
Algorithms using this invariant are snapshot-at-the-beginning algorithms.
- weakly reachable
When the Java collector(1) determines that an object is weakly reachable, it clears all the weak references involved, and declares the object finalizable. (Operationally, finalization works as if it was implemented by a class of “final references” that stand between weak and phantom references.) Also, the reference objects containing the weak references are enqueued, if they were registered with a queue.
- weighted buddies
A buddy system allocation mechanism using two series of size classes: binary buddies (2, 4, 8, …) and three-times-power-of-two (3, 6, 12, …). A block that is in the latter series may be split in two different ways. Thus a block of size 12 may be split into two blocks of size 6 or one block of size 4 and one block of size 8. The same applies for coalescing. This gives this system more flexibility than a regular buddy system.
- weighted reference counting
Inter-process references to objects are counted, but instead of simply counting the number of references, each reference is given a weight. When an object is created, the initial pointer to it is assigned a weight, which is usually a power of 2 for easy division. The object records the sum of all the weights of all of its references. Whenever a reference is copied, its weight is divided equally between the new and original copies. Since this operation preserves the weighted reference sum, there is no need for communication with the object at this time. When a reference is deleted, the weighted reference sum is decremented by the weight of the reference. This is communicated to the object by sending it a message. When the object detects that the weighted reference sum has dropped to zero, it may be reclaimed. The algorithm is tolerant of communication protocols which don’t guarantee order of arrival of deletion messages.
In a tri-color marking scheme, white objects are objects that were condemned at the beginning of the collection cycle and have not been shown to be reachable. When tracing is complete, white objects will be subject to reclamation.
Also known as
Almost all processor architectures have a characteristic data size that is handled most efficiently. This is known as the word size, and data of that size are known as words. The word size is usually a power of two multiple of bytes(2).
Often the platform’s word size is used to characterize the architecture by quoting the number of bits in it. For example, a 32-bit platform has a word size of four bytes and a 64-bit platform has eight-byte words (assuming 8-bit bytes). Typically, pointers are the size of a word, and traditionally this determined the word size. Nowadays, word size is usually driven by the need for more accuracy and range in mathematical calculations.
In the past, the convenience of dealing with powers of two was not as significant, and word sizes such as 36- or 72-bits were not unknown.
- working set
This term is generally used when discussing miss rates at some storage level; the time scale of “near future” depends upon the cost of a miss. The working set should fit in the storage level; otherwise the system may thrash.
- worst fit
In practice, this tends to work quite badly because it eliminates all large blocks, so large requests cannot be met.
A value is wrapped if it is encoded with type information.
A wrapper is that part of a wrapped representation that is copied when the value is passed by value.
The wrapper does not include parts of the representation that are accessed indirectly, and are not copied when the value is passed.
For instance, a Lisp implementation might use the top two bits of a value representation as a tag to distinguish between integers and cons(1) cells, setting these bits to 01 for a pointer to a cons cell and 11 for an integer. Then the wrapped value of the number 4 would have binary representation 11000…00100, and the wrapper for this number is the whole of this wrapped value. The pointer to a cons cell stored at location 4 would have binary representation 01000…00100. The wrapped value of the cons cell is the combination of this pointer and the cons cell in memory itself. The wrapper of the cons cell is just the pointer; when the cons cell is passed as a function argument, just the pointer is passed.
- write barrier
Relevance to memory management
- write fault
An exception which occurs when writing to an address in virtual memory.