Any way to reserve but not commit memory in linux?

前端 未结 4 1220
南方客
南方客 2020-12-01 03:00

Windows has VirtualAlloc, which allows you to reserve a contiguous region of address space, but not actually use any physical memory. Later when you want to use it (or part

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 03:32

    You can turn this functionality on system-wide by using kernel overcommit. This is usually default setting on many distributions.

    Here is the explanation http://www.mjmwired.net/kernel/Documentation/vm/overcommit-accounting

提交回复
热议问题