You can control the maximum amount of disk space that JE can use by setting two different threshold values. If JE exceeds either of these threshold values, writes will no longer be allowed to the database. Instead, when a write is attempted, DiskLimitException is thrown. The thresholds you can set are:
Specifies an upper limit on the total number of bytes that can be used for data storage.
By default, this property is set to 0
, which means no upper
limit is enforced. Instead, the value set for EnvironmentConfig.FREE_DISK will control your
how much disk space your database is allowed to consume.
If multiple JE environments share the same storage volume, Oracle recommends that you set EnvironmentConfig.MAX_DISK to a non-zero value, especially if an external application or service is also consuming space on the disk volume.
This value can be managed using the EnvironmentMutableConfig.setMaxDisk() method.
Specifies the minimum amount of free space to maintain on the disk volume. The default value is 5 GB, which is large enough to allow manual recovery if the free space threshold is exceeded.
If EnvironmentConfig.MAX_DISK is set to 0
, then the total amount of
space your JE database can consume is:
<disk_size> - <FREE_DISK>
So for a 300 GB volume and a free disk size of 5 GB, your database can grow to consume 295 GB.
If EnvironmentConfig.MAX_DISK is set to a non-zero value, then the total amount of space your JE database can consume is:
<MAX_DISK> - <FREE_DISK>
So for the same 300 GB volume, if max disk is 100 GB and free disk is 5 GB, then your database can consume at most 95 GB.
Be aware that the subtraction shown, above, is performed only if EnvironmentConfig.FREE_DISK is explicitly set or EnvironmentConfig.MAX_DISK is greater than 10GB. See the EnvironmentConfig.FREE_DISK Javadoc for more information.
For usage scenarios, see the EnvironmentConfig.MAX_DISK Javadoc.