How do I workaround heap fragmentation in a C++ server program?

后端 未结 4 1978
小蘑菇
小蘑菇 2020-12-19 19:57

Heap fragmentation can cause a server application that is expected to run continuously for many months to suddenly start malfunctioning thinking that it\'s out of memory.

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-19 20:34

    The obvious workaround is to dig up the old solutions that were invented in the past. For instance, opaque handles to movable objects instead of raw pointers. That allows you to defragment the heap.

提交回复
热议问题