A process to control memory of the computer is called Memory management. Memory management works on a computer physical memory. Memory stores the program and these programs are used by CPU for processing. Each computer has some preinstalled memory which is used for processing application or services. The main task of memory management is to ensure that all processes are always capable enough to access their memory and execute their task.There are two types of memory in a CPU. First is logical memory and the other one is physical. RAM (Random Access Memory) is also known as Temporary memory and the permanent memory such as HDD is also known as physical memory.
Must Know To Ace Memory Management Questions
Types of Memory:
Memory is used to store data and programs as permanent or temporary basis. In computer mainly, there are two types of memory used.
Primary Memory : Primary memory directly accesses the CPU. CPU read the instruction and executes them.There are two types of primary memory:
It stands for Random access memory. It store data on temporary basis because of this it is also called volatile memory. When the power is failed and your computer is switched off, RAM-stored data will be erased. There are different types of RAM which are named available such as SRAM, DRAM, and VRAM.
It stands for Read-only memory. In this memory, a user allows to read the data but not able to add or modify it.
There are some different types ROM available:
Secondary Memory: Secondary memory also called auxiliary memory used for a less expensive device that communicates indirectly with CPU through main memory. Secondary memory store data even after the power failure. Secondary memory are used to store large data files.Different types of Secondary storage:
Cache Memory :
It also called CPU memory. It is a high speed static random access memory. A microprocessor can access this memory easily rather than a regular random access memory. These memories are directly integrated with CPU.
Virtual Memory in OS: –
Virtual memory is a storage allocation scheme. It is also used for memory management. In the virtual memory, physical memory will work as Logical memory (RAM). In another work, we can increase the size of Logical Memory with the help of Virtual memory.
Shared Memory: –
In this method, processes can exchange data more quickly using regular operating system services.
Memory allocation in C: –
Dynamic memory allocation in c language enables the memory allocation for c program at runtime. In C language there is some standard library function which are available for dynamic memory allocation.
Malloc and calloc in C plays very important role and often referred as malloc c and calloc c.The malloc stands for ‘Memory allocation’ and calloc stands for ‘contiguous allocation’. This two function are used in c language for contiguous memory allocation.
Memory management implementation is based on architecture. Some OS supply an allocator for malloc. There is two basic allocators used for memory implementation in C.
When an application fails to release the memory and program not able to complete the task called Memory Leaks. It is a class of Bugs.
An operating system follows four memory management techniques.
You can find many stuffs about Memory Management in OS on internet.
DMA: Direct Memory Access is a technique that is used for transferring data from RAM to another part of the computer without using CPU.
Segmentation in OS: Segmentation is the common process to protect memory in which memory is divided into variable sized chunks and every chunk is called a Segment. Chunks can be allocated for processes.
Fragmentation in OS: Memory fragmentation is a condition when memory is divided into lot of little pieces and none of them is enough to satisfy the next memory requirement. Fragmentation occurs when you use disk frequently.
Research methodology: It is the process used to identify select, process and analyze information about a topic. Many Research methodology pdf files are available on internet for free which is very beneficial.
Memory management is usually performed by the host operating system. At an application level, memory management ensures the availability of memory for each and every task.
Interview Questions About Memory Management
- Q1. What is the Data Segment?
- Q2. What is Database Buffers?
- Q3.How will you Monitor Space Allocation?
- Q4.What are the types of Memory?
- Q5.What is dirty bit?
- Q6.What is a Shared pool?
- Q7.What is dictionary cache?
- Q8.What is hit ratio?
- Q9.What is a garbage collector?
- Q10. What is the return type of malloc() and calloc()?
- Q11. What is the key difference between malloc and calloc?
- Q12. Difference between static memory allocation and dynamic memory allocation?
- Q13. What is memory leak in C?
- Q14. What is dynamic memory fragmentation?
- Q15. What is SGA?