Memory trimming
Under certain workloads, glibc can accumulate a significant amount of free memory in its allocation arena. This memory consumes physical memory as indicated by its usage of resident set size (RSS), which glibc does not always return to the operating system. High retention of physical memory by glibc—glibc memory bloat—can adversely affect other processes, and, under high workloads, can sometimes cause the database to run out of memory.
OpenText™ Analytics Database provides two configuration parameters that let you control how frequently the database detects and consolidates much of the glibc-allocated free memory, and then returns it to the operating system:
- 
MemoryPollerTrimThreshold: Sets the threshold for the memory poller to start checking whether to trimglibc-allocated memory.The memory poller compares MemoryPollerTrimThreshold—by default, set to 0.83— with the following expression:RSS / available-memoryIf this expression evaluates to a value higher than MemoryPollerTrimThreshold, then the memory poller starts checking the next threshold—set inMemoryPollerMallocBloatThreshold—for glibc memory bloat.NoteOn high-memory machines where very large database RSS values are atypical, consider a higher setting forMemoryPollerTrimThreshold. To turn off auto-trimming, set this parameter to 0.
- 
MemoryPollerMallocBloatThreshold: Sets the threshold of glibc memory bloat.The memory poller calls glibc function malloc_info()to obtain the amount of free memory in malloc. It then comparesMemoryPollerMallocBloatThreshold—by default, set to 0.3—with the following expression:free-memory-in-malloc / RSSIf this expression evaluates to a value higher than MemoryPollerMallocBloatThreshold, the memory poller calls glibc functionmalloc_trim(). This function reclaims free memory from malloc and returns it to the operating system. Details on calls tomalloc_trim()are written to system tableMEMORY_EVENTS.For example, the memory poller calls malloc_trim()when the following conditions are true:- 
MemoryPollerMallocBloatThresholdis set to 0.5.
- 
malloc_info()returns 15GB memory in malloc free.
- 
RSS is 30GB. 
 NoteThis parameter is ignored ifMemoryPollerTrimThresholdis set to 0 (disabled).
- 
Trimming memory manually
If auto-trimming is disabled, you can manually reduce glibc-allocated memory by calling function 
MEMORY_TRIM. This function calls malloc_trim().