还可以把文件映射到内存,这是加快数据访问的理想解决方案。
You can map files into memory, as well-an ideal solution for accelerating data access.
如果我们想要探究内存映射文件结构的话,不需要构造一个流,只要找到该资源的名字即可。
If we explore the construction of the memory mapped file we can see that there is no stream, we just name the resource.
除了实际的文件,设备与共享内存对象都能够被映射。
In addition to actual files, devices and Shared memory objects can be mapped.
使用以上的XML文件,下面的屏幕截图会显示该结构实例的内存映射,如下所示。
Using the XML file above, the screen capture below shows the memory map rendering an instance of this structure, shown below.
进程的虚拟地址空间中的区域可被映射到物理内存、文件或任何其他可寻址存储。
Regions in a process's virtual address space can be mapped to physical memory, to a file, or to any other addressable storage.
在BCL的下一个版本中,. NET开发人员将能够直接使用内存映射文件,而无需通过平台调用的方式。
With the next version of the BCL,.net developers will be able to use memory-mapped files directly instead of via platform invoke calls.
这样,我们就创建了一个内存映射文件。
This will create the memory mapped file but to start using it we will need a map view.
MappedByteBuffer将文件所在区域直接映射到内存。
MappedByteBuffer maps a region of a file directly in memory.
创建合适的流之后,现在就可以创建内存映射文件了。
With the stream in place, we can now create the memory mapped file. Let's see an example.
在阅读完本文之后,您应该了解了NIO从基本的get和put操作到读取内存映射文件方面的知识。
After reading this article, you should understand NIO, from basic get and put operations to reading a memory-mapped file.
段3预留给内存映射文件,即mmap。
在本文后面,我将讨论第8种类型MappedByteBuffer,它用于内存映射文件。
I'll discuss an eighth type, MappedByteBuffer, available for memory-mapped files, later in this article.
高性能(支持SendFileAPI和内存映射文件)。
High performance (SendFile API support and memory-mapped files).
在某些情况下,还可以把一般文件或另一个设备的文件描述符映射到内存。
In some cases, you can also map a file descriptor to a plain file or another device into memory.
如果我们现在就要从内存映射文件读或写信息,只需要调用带有正确偏移量的映射视图方法就行了。
If we need now to write or read information from it we just call the map view methods with the correct offset.
顾名思义,一个内存映射文件将一个类似文件的结构映射到内存的地址中。
As the name implies, a memory-mapped file maps a file-like construct to an address in memory.
进而我们会看看内存映射原理、与之相关的文件读写机制以及内存使用情况图表所揭示的含义。
Coming up we'll look at memory mapping, how file reading and writing ties into all this and what memory usage figures mean.
文本段同样会将二进制文件映射到内存,但文件映射区域的写入操作只能以程序收到段错误而告终。
The text segment also maps your binary file in memory, but writes to this area earn your program a Segmentation Fault.
内存映射工具有其他的特性或者使用,而且通过咨询官方的文件文献,您还可以学到更多的关于它们的知识。
The memory mapping tool has other features and USES, and you can learn more about these by consulting the official product documentation.
为了创建一个内存映射赋值,您需要在定义您想要使用的布局的文件系统上选择文件。
To create a memory map rendering, you need to select the file on the file system that defines the layout you want to use.
因此,在上面的示例中,一共有16529个非计算性的文件分页被映射到了内存中。
So, in the above example, there are 16529 non-computational file pages mapped into memory.
最后,让我们来看一下另外一个有意思的领域:创建多个映射视图。它们同时工作访问同一个内存映射文件的不同区域。
Finally, another interesting area is the creation of multiple map views, these can work on the same memory mapped file accessing different areas of the files.
尽管数据段映射了文件,但这种内存映射是私有的,也就是说,数据段的内存更新不会在其映射的文件中生效。
Even though the data segment maps a file, it is a private memory mapping, which means that updates to memory are not reflected in the underlying file.
内存映射文件是把一块内存连接到一个文件的操作系统特性。
Memory-mapped files are an operating system feature that links a block of memory to a file.
该值还包括往返于非缓存、映射后的内存文件的页面。
This value also includes the pages to or from non-cached mapped memory files.
为了帮助改善启动时间,JVM现在和内存映射文件一起工作。
To help improve startup time, the JVM now works with memory-mapped files.
内存映射特性能够使您根据XML文件中所定义的布局来显示内存的某个区域。
The memory mapping feature enables you to display a region of memory according to a layout defined in an XML file.
如果两个应用程序打开了同一个内存映射文件,那么某个应用程序做出的改变会立即反映给另外一个应用程序。
If two applications open the same memory-mapped file, changes made by one application will be immediately visible to the other application.
包括读写文本文件的便捷方法,快速地列举目录,对内存映射文件的支持。
These include convenience methods for reading and writing text-based files, significantly faster directory enumeration, and support for memory mapped files.
在处理巨型文件时,真正的开发人员会转而使用一种技术,名为内存映射文件。
When working with very large files, native developers turn to a technique known as Memory-Mapped files.
应用推荐