禁用应用程序内部的linux内存过量使用 [英] Disabling linux memory overcommit inside an application

查看:36
本文介绍了禁用应用程序内部的linux内存过量使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以通过sysctls在整个系统范围内调整内存过量使用策略,但是是否可以在流程本身内部针对每个流程来调整此策略?我想使一个特定的实时过程永远不要使用过量使用,尽管系统的其余部分可能过量使用.

You can adjust the memory overcommit policy system wide via sysctls but is it possible to adjust this policy on a per-process basis from within the process itself? I want to make one particular real time process never use overcommit, though the rest of the system can overcommit.

推荐答案

否,这不可能.

有些相关,对于实时过程,您可能希望使用mlock或mlockall函数将地址空间固定到RAM.

Somewhat related, for a realtime process you probably want to use the mlock or mlockall functions to pin your address space to RAM.

这篇关于禁用应用程序内部的linux内存过量使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆