Specify minimum disk space to leave free when logging data
configures logging to leave at least the number of GB specified by
minDiskSpace free when logging data.
When you configure a minimum amount of disk space to leave free, you can also configure
the behavior when the free disk space limit is approached using the
Simulink.sdi.setDeleteRunsOnLowSpace function. For more information,
see Specify a Minimum Disk Space Requirement or Maximum Size for Logged Data.
Configure Logged Data Size Limits
Logging data from simulation can produce large amounts of data that may fill up disk space. To mitigate issues related to filing disk space, you can specify a minimum disk space requirement, a maximum size for logged data, or both. To ensure the logged data does not exceed the specified maximum size or use enough disk space to violate the disk space requirement, prior run data may be deleted and recording logged data may be disabled. You can specify whether to prioritize continuing to log data in the current simulation or retaining prior simulation data.
Simulink.sdi.setRequiredFreeSpace function to configure logging to leave at least 1 GB of disk space empty.
Simulink.sdi.setMaxDiskUsage function to specify a maximum logged data size of 100 GB.
When you configure logging size limits, you can also specify what to do when the logging limits are approached. You can choose whether to prioritize retaining data from prior runs or data in the current run.
By default, current simulation data is prioritized. If the size of logged data approaches configured limits, data from prior simulations is deleted. If deleting run data does not free enough space, recording logged data is disabled and no more data from the current simulation is saved. When you choose to prioritize logged data from prior simulations instead, recording is disabled as soon as the size of logged data approaches configured limits. You see a warning when run data is deleted and when recording is disabled.
Simulink.sdi.setDeleteRunsOnLowSpace function to configure logging to prioritize retaining prior run data.
If recording is disabled due to the size of logged data, you need to enable recording again to save data from future simulations. Use the
Simulink.sdi.setRecordData function to enable recording.
minDiskSpace — Minimum amount of free disk space required
0.1 (default) | scalar
Minimum amount of free disk space required, specified as a scalar, in units of GB. The minimum disk space requirement is a way to limit the size of logged data. The When low on disk space setting specifies what happens when the minimum disk space requirement is approached. For more information, see Specify a Minimum Disk Space Requirement or Maximum Size for Logged Data.
Simulink.sdi.setRequiredFreeSpace(0.5) configures logging
to leave at least half a gigabyte of free disk space.
Introduced in R2021a