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.

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...