- Process memory usage increases over weeks
- Receives data from multiple sockets, processes, exports over sockets
- ~40 Threads active
- ~4-5 GiB of data in process concurrently
- Very many allocations/deallocations, containers and small objects
- Try valgrind/massif
- Try gperftools/tcmalloc heapprofile
- to slow to see any results
- >12h for some minutes of playback data
:-(
- count memory allocations, deallocations, usage
- switch to pmr containers and allocate_shared
- search for possible culprits
demo2.cpp
- Simple to add statistics
- Memory Pools help
- avoid new/delete calls
- increase data locality
- but do not release memory until the pool is destroyed
- One
counting_memory_resouce
per software Component- see which component are most active
- And one per major data type
- identify which data uses most memory
- found several 100MiB unused data structures
- memory pools seem to reduce memory fragmentation