To mount the xmemfs file system, do the following: mount -F xmemfs -osize=4g xmem directory
You can also mount a xmemfs file system on /xmem at multi-user startup time prior to physical memory becoming fragmented. To do this, add the following line to your /etc/vfstab file: xmem - /xmem xmemfs - yes largebsize,size=4g
The xmemfs file system is expressly designed for performance-driven applications (for example, RDBMS) that require large amounts of physical memory. The xmemfs file system provides file system semantics to manage and access extended memory spaces that exceed
4 Gbytes. From an application perspective, extended memory under the control of a mounted xmemfs file system is viewed as a single, large memory pool that can be partitioned as needed through file creation. You can obtain windows into each memory partition by using mmap(2).
Memory controlled by xmemfs can be partitioned by creating files of the required size in the file system. The xmemfs file system allocates sufficient block-sized memory pages for a file based on the file's size. Files can be created using any standard file
utility, including mkfile(1M) and dd(1M).
The xmemfs file system optimizes the creation of large files that initially contain all zeroes by allocating memory pages for the file 'hole' that is created by writing beyond the end of file.
If sufficient xmemfs extended memory is available, an application can quickly create an 8 Gbyte file in the xmemfs file system by using llseek(2) to offset 8GB-1 and then write(2) a one-byte buffer containing zero. With xmemfs, you can share and protect partitioned
memory by setting appropriate file permissions. To avoid wasting memory resources, (especially with the -largebsize option specified), newly created option-specified files should be a multiple of the block size of the xmemfs file system. Creation of many small files
is strongly discouraged. See statvfs(2) for information on determining file system block sizes.
The xmemfs file system should only be used with performance-driven applications that require quick access to large amounts of physical memory. Using xmemfs for other applications may result in non-optimal use of system resources and possible system performance
degradation.
To maximize xmemfs ability to access a file's extended memory partition, use mmap(2). The initial mmap(2) call enables the system to assign a map size containing as much memory as an application may actively access at any time. The map size is constrained by the application's virtual address space, (usually a maximum of 3 Gbytes
on machines with more than 4 Gbytes of physical memory). To access extended memory that is not contained in the existing mapping, use mmap(2) with the -MAP_FIXED flag to remap a window within the address range returned by the initial mmap call.
|