ydb_catch_storagealloc environment variable triggers trappable error before process hits limit
Final Release Note
Description
At present, the MEMORY error is a hard error, and there is no way for application code to recover, take remedial action, and continue. This provides a mechanism to make an application more robust.
Draft Release Note
The environment variable ydb_catch_storalloc
, when set to an integer value representing a percentage from 1 through 99 triggers the MEMWARN error when a memory allocation would cause the memory allocation to exceed that percentage of ydb_max_storalloc
. An error trap that catches the error can take steps to reduce memory, for example by KILLing local variables. An unset value of the environment variable, or values other than integers from 1 through 99 are ignored. Note that it is the transition from below the trigger point to above the trigger point that triggers the error, and once triggered, will not be triggered again as YottaDB does not return memory to the operating system. [#1020]