What can be done to optimize computer memory?
Veröffentlichte Zeit: 2020-02-11 16:16:06
As with most computing and storage deployments today, computer memory space is capped.The resources of modern systems may not be as limited as memory, but operating systems, applications, and storage devices will always need more memory. But memory space is not infinite, and at some point it will run out completely, leading to system instability or data loss.
Since the advent of modern IT, the challenge of running out of memory space has been addressed by a variety of functions, often relegated to memory management, which is outlined below.
What is memory management?
Memory management is about making sure you have as much free memory space as possible to execute new programs, data, and processes.Since memory is used by multiple parts of modern operating systems, memory allocation and memory management can take different forms.
• operating systems -- operating systems such as Windows and Linux can use physical memory and hard disk swap space to manage memory pools of available memory.
• programming language -- C requires developers to manage memory utilization directly, while other languages (such as Java and C#) provide automatic memory management.
• applications - applications use and manage memory, but are usually limited by the underlying language and memory management functions defined by the operating system.
• storage memory management - with the new NVMe storage drive, the operating system can benefit from faster storage drives to help scale and implement a more durable form of memory management.
In order to process effectively, the memory management functions of the computer must be located between the hardware and the operating system.
How does memory management work
Memory management is about allocating and optimizing limited physical resources.For example, 2GB of RAM DIMM cannot be used as a large chunk of space.Instead, memory is partitioned into available memory cache blocks using memory allocation techniques.
A memory management strategy in an operating system or application typically involves knowing the physical address space available in memory and performing memory allocations to properly place, move, and delete processes from the memory address space.
The type of memory address
Static and dynamic memory allocations in the operating system are linked to different types of memory addresses.Basically, there are two core types of memory addresses:
• physical address -- refers to a storage location in system memory, identified as a set of Numbers.
• logical addresses -- sometimes referred to as virtual memory -- are the contents of the operating system and applications that access the executing code as an abstraction of the physical address space.
How does a memory management unit (MMU) convert a virtual address to a physical address?
The memory management unit (MMU) in a computing system is the core hardware component that converts a virtual logical address space into a physical address.The memory management unit (MMU) is usually physical hardware and is sometimes referred to as the paging memory management unit (PMMU).
The process by which the memory management unit (MMU) converts a virtual address to a physical address is called virtual address translation and converts one address type to another using the page catalog pointer table (PDPT).
This process is directly associated with page table assignments, matching and managing one address type to another.To help speed up virtual address translation, there is a caching mechanism called the transformation backup buffer (TLB), which is also part of the virtual address translation process.
Memory allocation: static and dynamic loading
Applications and data can be loaded into memory in many different ways. The two core methods are static loading and dynamic loading.
• static load -- code is loaded into memory before execution.For structured programming languages, including C.
• dynamic loading -- loading code into memory as needed.For object-oriented programming languages, such as the Java language.
When allocating memory in a system, not all available memory is always used in a linear fashion, which can lead to fragmentation.
There are two core types of memory fragmentation: internal and external
• internal fragmentation -- memory allocated to processes or applications, unused, unallocated, or fragmented memory.
• external fragmentation -- when memory is allocated and then freed, there may be less memory left, leaving memory holes or "fragments" that are not suitable for other processes.
Within the logical address space, virtual memory is partitioned using paging, which means it is divided into fixed memory units called pages.Pages can vary in size, depending on the underlying system architecture and operating system.The page management process can be complex.
• for more information on how to handle paging in Linux, see the full kernel.org documentation.
• for Windows, Microsoft provides detailed information about its paging process.
The memory segment in the main memory of a system is a complicated process of locating the memory unit.
Each segment in system memory has its own address for improved optimization and memory allocation.Segment register is the main mechanism of memory segment processing in modern systems.
Swap is the process by which the operating system requests additional memory from a storage device.
How a swap works is a storage area defined by the operating system as a "swap space," or storage space, where stored procedures are stored and run when physical and virtual memory space is exhausted, freed, and reclaimed.The use of swap space with traditional storage is a second-best way to extend the available memory because it incurs the overhead of transferring to and from physical memory.In addition, traditional storage devices run memory at slower interface speeds.
However, switching is now being reconsidered in order to expand memory through faster PCIe SSD drives, which offer interface connection speeds up to 16GB/s.In contrast, the maximum connection speed for SSD drives connected to SATA is 6.0GB/s.
Why memory management is required?
Memory management is an essential element of all modern computing systems.As virtualization continues to use and optimize resource utilization, memory is continually allocated, deleted, segmented, used, and reused.Using memory management techniques can reduce memory management errors that can cause instability and failure of systems and applications.
• maximize program memory availability;
• allows reuse and recycling of memory that is not actively used;
• you can extend the available physical memory by swapping.
• possible fragmentation of memory resources;
• increased complexity of system operations;
• introduce potential performance delays.Etikett: memory