By default, a vault grows automatically as more data is written to it, and shrinks automatically when its free space percentage reaches the threshold defined by the AutoCompactAt property.
Applications can use the following properties to both control, and obtain information about, a vault's size. Please refer to each one's documentation for more information.
- VaultSizeMax: Specifies the maximum size a vault can be; 0 (unlimited) by default.
- VaultSizeMin: Specifies the minimum size a vault can be; 0 by default.
- VaultSize: Reflects a vault's actual size; and can also be used to explicitly resize a vault, keeping in mind the following:
- A vault cannot shrink more than its available free space allows (i.e., not by more than VaultFreeSpace bytes).
- A vault cannot shrink beyond VaultSizeMin bytes.
- If VaultSizeMax is not 0 (unlimited), a vault cannot grow beyond VaultSizeMax bytes.
- If a vault grows enough to reach/exceed its AutoCompactAt threshold, it will automatically shrink again when the next automatic compaction occurs.
- VaultFreeSpace: Reflects the actual amount of free space a vault has available.
- PossibleSize: Reflects the maximum size a vault could possibly be.
- PossibleFreeSpace: Reflects the maximum amount of free space a vault could possibly have available.
For CBDrive, please note that the size of a vault backed by a storage volume or partition (i.e., one created/opened using the FormatVolume/OpenVolume methods) is identical to the size of said storage volume or partition itself. Such vaults, once created, cannot be resized using any of the properties or methods discussed above.