微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Linux上的可清除内存区域

在Mac OS X上,vm_allocate()允许创建可清除的内存区域.当检测到记忆压力时,内核可以在任何时间(除非被锁定时)被内核回收.它对于缓存数据等非常有用.

我想知道Linux(内核2.6)上是否存在类似的机制.谷歌搜索引导我在Android上讨论可能被清除的共享内存分配的一些信息,但我还没有看到任何有关在vanilla Linux上实际执行此操作的API的讨论.对mmap,shmat等的手册页的检查显示没有用于设置可清除区域的标志. Linux上是否提供此功能

Android上有关此功能的说明如下:

MemoryFile Reference

MemoryFile Sample

谢谢!

最佳答案
2.6.39-rc1中有类似的系统.它被称为“超越记忆”:

> Transcendent memory,2009
> Transcendent memory in a nutshell,2011
> 2011年的幻灯片Transcendent Memory
and Friends,TmemNotVirt-Linuxcon2011-Final.pdf
(它还列出了一些类似的术语)
> oss.oracle的Api规范:Transcendent Memory Interface Specification
Version 0.0.1 – 081202

更新:维基百科还有一个短片:https://en.wikipedia.org/wiki/Transcendent_memory

In computing,transcendent memory (aka “tmem”) is a concept explored by Dan Magenheimer.
Transcendent memory is a class of memory that is of unkNown and dynamically variable size,is addressable only indirectly by the kernel,can be configured either as persistent or as “ephemeral” (meaning it will be around for a while,but might disappear without warning),and is still fast enough to be synchronously accessible

One can think of transcendent memory as a sort of RAM disk with some interesting characteristics: nobody kNows how big it is,writes to the disk may not succeed,and,potentially,data written to the disk may vanish before being read back again. At a first blush,it may seem like a relatively useless sort of device,but it is hoped that transcendent memory will be able to improve performance in a few situations.

Introduced in Linux kernel 2.6.39.[1][2] Implementation by Dan Magenheimer of Oracle Corporation. Xen 4.0 supports tmem in the hypervisor.

原文地址:https://www.jb51.cc/linux/439883.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐