Presentation made by Steponas Šipaila

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Chapter 6: Memory Management
Kernel memory allocation
Chapter 12. Kernel Memory Allocation
KERNEL MEMORY ALLOCATION Unix Internals, Uresh Vahalia Sowmya Ponugoti CMSC 691X.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
CS 1114: Data Structures – Implementation: part 1 Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Dynamic memory allocation and fragmentation Seminar on Network and Operating Systems Group II.
Memory Management Memory Areas and their use Memory Manager Tasks:
Chapter 3.1 : Memory Management
Memory Management A memory manager should take care of allocating memory when needed by programs release memory that is no longer used to the heap. Memory.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Computer Organization and Architecture
1 Chapter 3.1 : Memory Management Storage hierarchy Storage hierarchy Important memory terms Important memory terms Earlier memory allocation schemes Earlier.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Memory Allocation CS Introduction to Operating Systems.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
CY2003 Computer Systems Lecture 09 Memory Management.
Memory Management COSC 513 Presentation Jun Tian 08/17/2000.
Memory Management. Memory  Commemoration or Remembrance.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
1 Advanced Memory Management Techniques  static vs. dynamic kernel memory allocation  resource map allocation  power-of-two free list allocation  buddy.
The buddy memory allocation algorithm Παρουσίαση : Δρ. Αναγνωστό π ουλος Χρήστος.
11/26/2015IT 3271 Memory Management (Ch 14) n Dynamic memory allocation Language systems provide an important hidden player: Runtime memory manager – Activation.
CS 241 Discussion Section (11/17/2011). Outline Review of MP7 MP8 Overview Simple Code Examples (Bad before the Good) Theory behind MP8.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management -Memory allocation -Garbage collection.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
CS 241 Discussion Section (2/9/2012). MP2 continued Implement malloc, free, calloc and realloc Reuse free memory – Sequential fit – Segregated fit.
CS 241 Discussion Section (12/1/2011). Tradeoffs When do you: – Expand Increase total memory usage – Split Make smaller chunks (avoid internal fragmentation)
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
External fragmentation in a paging system Use paging circuitry to map groups of noncontiguous free pages into logically contiguous addresses (remap your.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
Memory Management Damian Gordon.
Memory Management Chapter 7.
Chapter 7 Memory Management
Storage Allocation Mechanisms
Section 10: Memory Allocation Topics
Memory Management Memory Areas and their use Memory Manager Tasks:
Chapter 2 Memory and process management
Day 19 Memory Management.
Day 19 Memory Management.
CHP - 9 File Structures.
Memory Allocation The main memory must accommodate both:
Partitioned Memory Allocation
Operating Systems (CS 340 D)
Storage Management.
William Stallings Computer Organization and Architecture
Day 18 Memory Management.
Memory Management Memory Areas and their use Memory Manager Tasks:
CSI 400/500 Operating Systems Spring 2009
Main Memory Management
Module IV Memory Organization.
Chapter 8: Main Memory.
Chapter 11: File System Implementation
O.S Lecture 13 Virtual Memory.
CS Introduction to Operating Systems
Lecture 3: Main Memory.
Operating System Chapter 7. Memory Management
Memory Management (1).
Memory Management Memory Areas and their use Memory Manager Tasks:
COMP755 Advanced Operating Systems
Memory Management Memory management is the art and the process of coordinating and controlling the use of memory in a computer system Why memory management?
Presentation transcript:

Presentation made by Steponas Šipaila Memory management Presentation made by Steponas Šipaila

What is memory management? is a form of resource management applied to computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when no longer needed. Memory management resides in hardware, in the OS and in applications.

Memory management in hardware In hardware, memory management involves components that physically store data, such as RAM(random access memory) chips, memory caches, and flash- based SSDs (solid-state drives).

Memory management in hardware and the operating system In the OS, memory management involves the allocation and constant reallocation of specific memory blocks to individual programs as user demands change.

Memory management at the application level At the application level, memory management ensures the availability of adequate memory for the objects and data structures of each running program at all times.  Application-level memory management is usually categorized as: Automatic memory management Manual memory management

Dynamic memory allocation The task of fulfilling an allocation request consists of locating a block of unused memory of sufficient size.

External fragmentation arises when there are many small gaps between allocated memory blocks, which invalidates their use for an allocation request.

The allocator’s metadata can also inflate the size of individually small allocations. This is often managed by chunking. Chunking refers to strategies for improving performance by using special knowledge of a situation to aggregate related memory-allocation requests. The memory management system must track outstanding allocations to ensure that they do not overlap and that no memory is ever "lost"

Implementations Since the precise location of the allocation is not known in advance, the memory is accessed indirectly, usually through a pointer reference. The specific algorithm used to organize the memory area and allocate and deallocate chunks is interlinked with the kernel, and may use any of the following methods: Fixed-size blocks allocation Buddy blocks Slab allocation Garbage collection

Fixed-size blocks allocation Fixed-size blocks allocation uses a free list of fixed-size blocks of memory (often all of the same size). Works well for simple systems where no large objects need to be allocated. Due to the significantly reduced overhead this method can substantially improve performance for objects that need frequent allocation / de-allocation and is often used in video games.

Buddy blocks Memory is allocated into several pools of memory instead of just one, where each pool represents blocks of memory of a certain power of two in size, or blocks of some other convenient size progression.

All blocks of a particular size are kept in a sorted linked list or tree and all new blocks that are formed during allocation are added to their respective memory pools for later use. If a smaller size is requested than is available, the smallest available size is selected and split.

One of the resulting parts is selected, and the process repeats until the request is complete. When a block is allocated, the allocator will start with the smallest sufficiently large block to avoid needlessly breaking blocks. When a block is freed, it is compared to its buddy. If they are both free, they are combined and placed in the correspondingly larger-sized buddy-block list.

However, there still exists the problem of memory being wasted because the memory requested is a little larger than a small block, but a lot smaller than a large block. 

Slab allocation This memory allocation mechanism pre-allocates memory chunks suitable to fit objects of a certain type or size. These chunks are called caches and the allocator only has to keep track of a list of free cache slots. Constructing an object will use the any one of the free cache slots and destructing an object will add a slot back to the free cache slot list. This technique alleviates memory fragmentation and is efficient as there is no need to search for a suitable portion of memory, as any open slot will suffice.

Garbage collection Garbage collection is a strategy for automatically detecting memory allocated to objects that are no longer usable in a program, and returning that allocated memory to a pool of free memory locations. This method is in contrast to "manual" memory management. Reduces programmer workload but in return requires memory resources of its own

Thank you for your attention!