Skip to main content

Memory-Mapped Files

A memory-mapped file contains the contents of a file in virtual memory and is an application’s logical address space. This mapping between a file and memory space enables an application, including multiple processes, to modify the file by reading and writing directly to the memory. Starting with the .NET Framework version 4, you can use managed code to access memory-mapped files in the same way that native Windows functions access memory-mapped files, as described in Managing Memory-Mapped Files in Win32 in the MSDN Library.
There are two types of memory-mapped files:
  • Persisted memory-mapped files
    Persisted files are memory-mapped files that are associated with a source file on a disk. When the last process has finished working with the file, the data is saved to the source file on the disk. These memory-mapped files are suitable for working with extremely large source files. The following illustration shows memory-mapped files that are persisted to disk.
  • Non-persisted memory-mapped files
    Non-persisted files are memory-mapped files that are not associated with a file on a disk. When the last process has finished working with the file, the data is lost and the file is reclaimed by garbage collection. These files are suitable for creating shared memory for inter-process communications (IPC). The following illustration shows memory-mapped files that are not persisted to disk.

Comments

Popular posts from this blog

ASP.NET 5 and MIDDLEWARE

ASP.NET 5 has been largely rewritten from the ground up, and incorporates some radical changes when compared with previous versions of ASP.NET. One of the biggest changes is in the HTTP Pipeline. This article looks at how those changes impact the design and registration of plug and play components that used to be represented by HttpModules. full blog 

MAUI to replace Xamarin

NET Multi-platform App UI (MAUI) NET Multi-platform App UI (MAUI) is a multi-platform technology for developing mobile (iOS and Android) and desktop (Windows and Mac) applications. NET MAUI is an evolution of Xamarin. Forms, they have most of their features in common. You can get almost all things in . NET MAUI that Xamarin has, like controls, layouts, Shell, gestures, templates, and cross-platform APIs for device features. Disadvantages It is a new product that has just been released and, although the released version is stable, some essential controls such as maps are still missing. Does Maui replace WPF? Building a WPF app is not supported in MAUI - as noted, they are two different UI implementations which both run on . Net 6. WPF is Windows specific, while MAUI is cross-platform. Compared to Flutter Flutter apps tend to be smaller and faster than those built with . NET MAUI. This is partly due to the small size of the compiled code. Overall, Flutter provides a more efficient and fl...