9月 062017
 

mlock可以锁住一部分内存,锁住干啥?

这里的锁住的真实含义是不让交换到swap上去。

用途:

  1. real-time Application
    1. 对于实时应用来讲,就是要反应迅速,所以,事件发生后才发现内存中的数据被交换到swap上去了,那就太耽误事了
  2. 出于安全考虑
    1. 安全信息只要落地了(哪怕是被swap出来的)就容易泄露,所以,敏感信息经常mlock
  3. 就是不想swap(管我呢)

限制:

ulimit可以限制允许mlock的内存大小

查看:

cat /proc/$pid/status |grep VmLck

 

参考:
 Posted by at 上午 11:43

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据