Memory Allocation/Deallocation Bottleneck?

后端 未结 12 1982
轮回少年
轮回少年 2020-11-30 20:44

How much of a bottleneck is memory allocation/deallocation in typical real-world programs? Answers from any type of program where performance typically matters are welcome.

12条回答
  •  佛祖请我去吃肉
    2020-11-30 21:27

    Allocating and releasing memory in terms of performance are relatively costly operations. The calls in modern operating systems have to go all the way down to the kernel so that the operating system is able to deal with virtual memory, paging/mapping, execution protection etc.

    On the other side, almost all modern programming languages hide these operations behind "allocators" which work with pre-allocated buffers.

    This concept is also used by most applications which have a focus on throughput.

提交回复
热议问题