Shared Memory
The Process shared memory object is a region of non-paged physical memory that can be mapped into the virtual address space of a process. When a shared memory object has a name, additional processes may map the region of memory. A shared memory object is accessed with both a handle and a virtual address. For a process to completely end its access to a shared memory object it must close the handle. When all processes end their access to a shared memory object, the following occurs:
- The memory region is returned to the local memory pool.
- The object ceases to exist.
Note: Shared memory objects are created from the system's external allocation space (ExtMSpace).
The Process shared memory object is its own named object. If you are familiar with a Windows program, when you allocate memory, then map a view of that memory, the RtCreateSharedMemory and RtOpenSharedMemory calls implicitly map the shared memory; this eliminates the explicit Win32 call to the MapViewOfFile call. When the shared memory object is created, Process backs the shared memory object with non-paged memory.
Note: Shared memory cannot be greater than 4GB.
In this section: