内存映射文件(Memory-Mapped Files)
来源:互联网 发布:淘宝优惠卷软件挣钱 编辑:程序博客网 时间:2024/06/13 05:48
内存映射文件(Memory-Mapped Files)可以用来:
(1)操作系统用来加载进程和动态库
(2)访问硬盘文件
The primary benefit of memory mapping a file is increasing I/O performance, especially when used on large files. memory mapped files is faster than using direct read and write operations for two reasons. Firstly, a system call is orders of magnitude slower than a simple change to a program's local memory. Secondly, in most operating systems the memory region mapped actuallyis the kernel'spage cache (file cache), meaning that no copies need to be created in user space.
(3)进程间共享数据
事实上Windows的进程间通信如RPC,COM,OLE,DDE,windows messages(WM_COPYDATA等),the Clipboard, mailslots,pipes, sockets等其底层机制都是Memory-Mapped Files.
其缺点:
The major reason to choose memory mapped file I/O is performance. Nevertheless there can be tradeoffs. The standard I/O approach is costly due to system call overhead and memory copying. The memory mapped approach has its cost inminor page faults - when a block of data is loaded inpage cache, but is not yet mapped into the process's virtual memory space. In some circumstances, memory mapped file I/O can be substantially slower than standard file I/O.
Another drawback of memory mapped files relates to a given architecture's address space: a file larger than the addressable space can have only portions mapped at a time, complicating reading it. For example, a32-bit architecture such as Intel'sIA-32 can only directly address 4GiB or smaller portions of files. This drawback is avoided in the case of devices addressing memory when anIOMMU is present.
- 内存映射文件(Memory-Mapped Files)
- Windows核心编程——》第十七章 内存映射文件 (Memory-Mapped Files)
- C# .Net 共享内存 内存映射文件 Memory Mapped 转
- 映射内存(Mapped memory)示例
- memory-mapped files
- Memory-Mapped Files
- Memory-mapped files
- C# .Net 多进程同步 通信 共享内存 内存映射文件 Memory Mapped
- C# .Net 多进程同步 通信 共享内存 内存映射文件 Memory Mapped
- C# .Net 多进程同步 通信 共享内存 内存映射文件 Memory Mapped 转
- C# .Net 多进程同步 通信 共享内存 内存映射文件 Memory Mapped
- 为何要在Java中使用内存映射文件(Memory Mapped File)或者MappedByteBuffer
- 内存映射文件(memory-mapped file)能让你创建和修改那些大到无法读入内存的文件。
- RandomAccessFile 和 FileChannel【memory-mapped files】
- 内存映射文件(Memory Mapping File)
- IO的端口映射和内存映射 (Port mapped I/O 和 Memory mapped I/O说明)
- Memory Map 内存映射
- How to implement growable memory-mapped files (GMMFs) in NTFS
- 四种对象的作用域
- Cannot load php5apache2.dll into server Apache is running a threaded MPM,
- php类型
- woj1010- Alternate Sum
- 中国象棋 军 规则判断
- 内存映射文件(Memory-Mapped Files)
- ZOJ 1700 Falling Leaves 树形结构
- 精通git中文版(连载十七)
- Flex学习篇之一:初识Flex
- 求多个数最小公倍数的一种变换算法
- DepartmentDaoImpl
- 入住CSDN博客
- python中web应用程序与web服务
- PHP中常用的数组函数