Mitigating the performance impact of memory bloat

Thumbnail Image
Lee, Sangho
Pande, Santosh
Associated Organization(s)
Organizational Unit
Supplementary to
Memory bloat is loosely defined as an excessive memory usage by an application during its execution. Due to the complexity of efficient memory management that developers have to deal with, memory bloat is pervasive and is often neglected in favor of lower application development cost. Unfortunately, when the bloat becomes severe, unwanted performance issues may occur due to its impact on memory management mechanisms and memory layout. In light of this, this dissertation identifies three pervasive causes of performance issues due to memory bloat and presents feedback-driven solutions for each. First, in certain languages like C/C++, applications have to manually manage memory in terms of allocation and deallocation. When users forget to free an allocated memory (due to a bug), this leads to a form of memory bloat known as memory leak. The presence of memory leaks causes gradual exhaustion of system memory and eventually leads to serious performance degradation of production systems. To prevent the obvious consequences of memory leaks, we present a memory leak detection framework that relies on object behavior introspection. Our framework models behavioral changes of hypothetically leaked objects in terms of their staleness and coexistence patterns among the allocated objects. With the introspective memory leak detection framework, we observed significant memory bloat savings upon weeding out the discovered memory leaks. Second, memory bloat prevention mechanisms in multi-threaded memory allocators is another source of performance issues. When the bloat prevention mechanism is frequently triggered unnecessarily as an artifact of intensive memory allocations/deallocations, an application may experience suboptimal performance. To address this, we present a feedback-directed tuning mechanism for TCMalloc, a widely used memory allocator for high performance systems. Our optimization technique tunes the thread cache management mechanism in TCMalloc to the memory allocation behavior of an application and reduces the management cost of the internal data structures in TCMalloc. With the proposed technique integrated into FDO in GCC, we observed up to 10\% improvement in application performance. Third, in some languages like Java, memory is automatically managed through garbage collection. Memory bloat in Java applications occurs due to performance unconscious designs and implementations. When an application uses an excessive amount of memory by creating more objects than are necessary, negative performance impacts such as high garbage collection overhead may arise. To address this issue, we present an object recycle optimization technique for Java applications. Our technique uses a static analysis to figure out safe-deallocation sites of objects and uses a dynamic profiling to select allocation sites for code transformation. With the optimization technique, We observed up to 10\% improvement in application performance on the DaCapo 2006 benchmark applications. In summary, this dissertation comprehensively analyzes and proposes solutions to the performance issues due to memory bloat in both manual and automated memory managed systems.
Date Issued
Resource Type
Resource Subtype
Rights Statement
Rights URI