Memory stability of a C++ application in Linux

前端 未结 6 1149
余生分开走
余生分开走 2021-01-03 05:14

I want to verify the memory stability of a C++ application I wrote and compiled for Linux. It is a network application that responds to remote clients connectings in a rate

6条回答
  •  感情败类
    2021-01-03 05:43

    It is not typical for an OS to release memory when you call free or delete. This memory goes back to the heap manager in the runtime library.

    If you want to actually release memory, you can use brk. But that opens up a very large can of memory-management worms. If you directly call brk, you had better not call malloc. For C++, you can override new to use brk directly.

    Not an easy task.

提交回复
热议问题