Operating System Fundamentals


Efficient Memory Management



Download 2.34 Mb.
View original pdf
Page39/66
Date06.03.2023
Size2.34 Mb.
#60834
1   ...   35   36   37   38   39   40   41   42   ...   66
OperatingSystemFundamentals
best answers from c, Lesson 2 C# Windows Forms
Efficient Memory Management
A well designed operating system should make access and the management of resources as efficient as possible for both the user and the system. Efficient memory management includes keeping track of all memory resources that have been allocated to different processes. It also includes using different strategies for allocating free memory as it is needed by new processes. When it comes to the allocation of memory spaces and the retrieval of data from memory, you can compare the memory manager to the local telephone company. There are many ways that the phone company can keep track of telephone numbers that have been assigned to customers. One way is to keep a sequential list of all phone numbers, along with the names of the subscribers. Another way is to keep track of the names of subscribers, along with their assigned phone numbers (like a phone book. An efficient memory manager would use both types of strategies to keep track of data stored in RAM. The first strategy is useful for examining address ranges and finding free memory that is available for use. The second strategy is useful for examining individual processes, and keeping track of what memory each process is using. An operating systems memory manager is also responsible for using different strategies to allocate free memory to new processes. Each strategy has its advantages and disadvantages. The aim of the operating system is to use the most effective strategy to both minimize the time needed to save and access data, and to maximize the amount of usable space left in memory. You can compare this task to parking vehicles in a parking lot. For example, you could parka motorcycle in the first available space. If it is a very big space, then you will end up reducing the maximum number of vehicles you can park in the lot, because the rest of the space may not be quite big enough to fit another vehicle. Conversely, you could try looking for the smallest possible parking space where the motorcycle will fit. The drawback here is that it might take you longer to find such a spot. There are three main strategies that the memory manager can use when allocating free memory to processes Best Fit o Find the smallest free memory block that will fit the process needs o Idea is minimize wastage of free memory space Worst Fit o Find the largest free memory block that will fit the process needs o Idea is to increase the possibility that another process can use the leftover space First Fit o Find the first space to fit the memory needs o Minimize the time to analyze the memory space available

Download 2.34 Mb.

Share with your friends:
1   ...   35   36   37   38   39   40   41   42   ...   66




The database is protected by copyright ©ininet.org 2024
send message

    Main page