Community
Participate
Working Groups
Build Identifier: I20110613-1736 org.eclipse.cdt.debug.edc.internal.StreamBufferBase is an abstract class used by MemoryStreamBuffer among others. It allocates BUFFER_SIZE = 4096 bytes for use as a buffer for reading whatever underlying source that its children are wrapping. However in many cases (particularly for MemoryStreamBuffer) what is being buffered is much smaller than 4096 bytes, for example 1 byte. Hence this behavior results in excessive memory usage. The patch to fix this more than halves memory consumption under some workloads. Reproducible: Always Steps to Reproduce: 1. Analyze something sufficiently well that the whole executable (or close to it) is read in. 2. Use -Xmx368m -XX:+HeapDumpOnOutOfMemoryError or similar to cause a heap dump to occur when it uses lots of memory 3. Use MemoryAnalyzer to analyze where all the memory is going (this may take some time)
Created attachment 200697 [details] Patch to fix buffer size to smallest power of 2 large enough if 4096 too high
patch applied and nominally tested locally; awaiting final review and final merge to eclipse edc git repository by ken ryall.
Fixed in: http://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/commit/?id=f7c4790c134d0cdc30cdbe8d2a016bf27cd25528