Looking for a Tutor Near You?

Post Learning Requirement »
x
x

Direction

x

Ask a Question

x

Hire a Tutor

Memory Managment In Linux

Loading...

Published in: Software Testing
471 Views

This Presentation is mostly given in Software Engineering 6th Semester, Course name is OS (Operating Systems). You will learn Memory Managment in Linux. what is memory management? Memory Managment in Linux. what is its purpose? Virtual memory in Linux?

Bilal H / Sharjah

8 years of teaching experience

Qualification: Masters in Computer Science

Teaches: Programming Technology, C#, Java, Python, English, Science, Maths, Biology, Chemistry, Computer Science, Mathematics

Contact this Tutor
  1. Memory management
  2. Allocation and de-allocation of memory of memory in an efficient way.
  3. P LJfPL)3e Of We want that main memory has to be used in an efficient way. Make Sure Minimum memory has to be given to a process that he will execute easily.
  4. When your system runs low on RAM Your Windows moves the least used "pages" of memory out to a hidden file named pagefile.sys What this actually means to you ? Swapper Basic Idea Least Recently Used .(LRU)
  5. Linux used separate partition for pagesfile. Swap space in Windows • Ideal Linux swap space
  6. Partjtjor) jn Ljr) Create new Partition Minimum size: 1 Mia Free space preceding (Mia): Maximum size. Create as, File system: Label: 927 Mia Primary Partition New size (Mia) Free space following (Mia): Align to. 927 Mia Iinux-swap @ Cancel + Add
  7. Linux divides its physical RAM into chucks of memory called pages. The combined sizes of the physical memory and the swap space is the amount of virtual memory available. Swapping is necessary for two important reasons.
  8. 1, 2. 3, 4. PFRA uses a clock-like algorithm to select old pages for eviction within a certain category. Linux distinguishes between four different types of pages. Irreclaimable swappable syncable discardable
  9. 1. 3, 4. 31err) Also called user-level MM. Dynamic Memory Allocation. A system call is am request for the OS to do something on behalf of the user's program. The system calls are functions used in the kernel itself. ma110C(), ca110C() realloc() free()
  10. snallDC() The value passed in is the total number of bytes requested. The return value is a pointer to the newly allocated memory or NULL if memory could not be allocated. errno() will be set to indicate the error. errno() is a special variable that system calls and library functions set to indicate what went wrong.
  11. When you're done using the memory, you "give it back" by using the free() function. Once free(coordinates) is called, the memory pointed to by coordinates is off/imits. It now "belongs" to the allocation subroutines.
  12. Dynamic memory has a significant advantage over statically declared arrays. it's possible to use exactly as much memory as you need, and no more. it's possible to change the size of a dynamically allocated memory area. Although it's possible to shrink a block of memory, more typically, the block is grown. Changing the size is handled with realloc()
  13. Allocating and Zero-filling: calloc() The calloc() function is like malloc(). Its primary advantage is that it zeros the dynamically allocated memory. It also performs the size calculation for you by taking as parameters the number of items and the size of each.
  14. Thank you