Nested STL vector using way too much memory

后端 未结 6 1479
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 16:19

I have an STL vector My_Partition_Vector of Partition objects, defined as

struct Partition // the event log data structure
{
    in         


        
6条回答
  •  广开言路
    2021-01-06 16:55

    If you store a near constant amount of objects, then I suggest to use a 2-dimensional array.

    The most likely reason for the memory consumption is debug data. STL implementations usually store A LOT of debug data. Never profile an application with debug flags on.

提交回复
热议问题