Sunday , January 19 2020
Home / Windows / Memory Management in Operating System

Memory Management in Operating System

Memory Management in Operating System

Memory management is the functionality of an operating system which handles or manages primary memory. Memory management keeps track of each and every memory location either it is allocated to some process or it is free. It checks how much memory is to be allocated to processes. It decides which process will get memory at what time. It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status.

Memory management provides protection by using two registers, a base register and a limit register. The base register holds the smallest legal physical memory address and the limit register specifies the size of the range. For example, if the base register holds 300000 and the limit register is 1209000, then the program can legally access all addresses from 300000 through 411999.

Memory Management in Operating System

Read:-  What is multi-threading operating system

Memory Management in Operating System

Instructions and data to memory addresses can be done in following ways:-

  • Compile time: When it is known at compile time where the process will reside, compile time binding is used to generate the absolute code.
  • Load time: When it is not known at compile time where the process will reside in memory, then the compiler generates re-locatable code.
  • Execution time: If the process can be moved during its execution from one memory segment to another, then binding must be delayed to be done at run time.

Dynamic Loading

In dynamic loading, a routine of a program is not loaded until it is called by the program. All routines are kept on disk in a re-locatable load format. The main program is loaded into memory and is executed. Other routines methods or modules are loaded on request. Dynamic loading makes better memory space utilization and unused routines are never loaded.

Dynamic Linking

Linking is the process of collecting and combining various modules of code and data into a executable file that can be loaded into memory and executed. Operating system can link system level libraries to a program. When it combines the libraries at load time, the linking is called static linking and when this linking is done at the time of execution, it is called as dynamic linking. In static linking, libraries linked at compile time, so program code size becomes bigger whereas in dynamic linking libraries linked at execution time so program code size remains smaller.

Logical versus Physical Address Space

An address generated by the CPU is a logical address whereas address actually available on memory unit is a physical address. Logical address is also known a Virtual address. Virtual and physical addresses are the same in compile-time and load-time address-binding schemes. Virtual and physical addresses differ in execution-time address-binding scheme. The set of all logical addresses generated by a program is referred to as a logical address space. The set of all physical addresses corresponding to these logical addresses is referred to as a physical address space.

The run-time mapping from virtual to physical address is done by the memory management unit (MMU) which is a hardware device. MMU uses following mechanism to convert virtual address to physical address.

  • The value in the base register is added to every address generated by a user process which is treated as offset at the time it is sent to memory. For example, if the base register value is 10000, then an attempt by the user to use address location 100 will be dynamically reallocated to location 10100.
  • The user program deals with virtual addresses; it never sees the real physical addresses.

Swapping

Swapping is a mechanism in which a process can be swapped temporarily out of main memory to a backing store, and then brought back into memory for continued execution. Backing store is a usually a hard disk drive or any other secondary storage which fast in access and large enough to accommodate copies of all memory images for all users. It must be capable of providing direct access to these memory images.

Major time consuming part of swapping is transfer time. Total transfer time is directly proportional to the amount of memory swapped. Let us assume that the user process is of size 100KB and the backing store is a standard hard disk with transfer rate of 1 MB per second. The actual transfer of the 100K process to or from memory will take

100KB / 1000KB per second

= 1/10 second

= 100 milliseconds

Memory Management in Operating System

Memory Allocation

Main memory usually has two partitions

  • Low Memory: Operating system resides in this memory.
  • High Memory: User processes then held in high memory. Operating system uses the following memory allocation mechanism.

Memory Management in Operating System

Fragmentation

As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation.

Fragmentation is of two types:-

Memory Management in Operating System

External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic.

I hope that you understand my post. if you like this post then share my post, and comment on my post if you have any suggestion or Queries related to Memory Management in Operating system. Thank you!

Check Also

How to install mac os in virtual box

How to install mac os in virtual box macOS first came out in 2001, and …

45 comments

  1. It’s really a nice and useful piece of info. I’m glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing.

  2. Hello. I have checked your technicalfan.com and i see you’ve got some duplicate content
    so probably it is the reason that you don’t rank hi in google.

    But you can fix this issue fast. There is a tool
    that rewrites articles like human, just search in google: miftolo’s tools

  3. Howdy! This is my 1st comment here so I just wanted to give a quick shout out and tell you I really enjoy reading your blog posts. Can you recommend any other blogs/websites/forums that cover the same topics? Thanks for your time!

  4. My partner and I absolutely love your blog and find
    the majority of your post’s to be just what I’m looking for.
    Does one offer guest writers to write content for you personally?

    I wouldn’t mind creating a post or elaborating on a few of the subjects
    you write related to here. Again, awesome website!

  5. I every time emailed this website post page to all
    my friends, since if like to read it next my contacts will too.

  6. When I originally commented I clicked the “Notify me when new comments are added”
    checkbox and now each time a comment is added I
    get several emails with the same comment. Is there any way you can remove me from that service?
    Appreciate it!

  7. You can definitely see your expertise in the work you write.
    The sector hopes for even more passionate writers such as you who aren’t afraid to mention how they believe.
    Always follow your heart.

  8. It’s amazing in favor of me to have a web page, which is useful
    for my knowledge. thanks admin

  9. It’s perfect time to make some plans for the future and
    it’s time to be happy. I have read this post and if I could I desire to suggest you some interesting things or suggestions.
    Perhaps you can write next articles referring to this article.
    I want to read more things about it!

  10. Hey there! Do you use Twitter? I’d like to follow you if that would be ok.
    I’m absolutely enjoying your blog and look forward
    to new updates.

  11. Highly descriptive post, I loved that a lot. Will there be a part 2?

  12. Right here is the perfect webpage for everyone who would like to
    find out about this topic. You understand so much its almost tough to argue with you (not that I really would want to…HaHa).

    You definitely put a brand new spin on a topic that has been written about for decades.
    Wonderful stuff, just wonderful!

  13. hello!,I like your writing so much! share we keep in touch more about your article on AOL?

    I need a specialist in this house to solve my problem.
    Maybe that is you! Taking a look forward to peer you.

  14. I like the helpful info you provide on your articles.
    I’ll bookmark your weblog and test again here regularly.

    I am relatively certain I will learn lots of new stuff right right here!
    Best of luck for the next!

  15. You can certainly see your expertise within the article you write.

    The world hopes for even more passionate writers like you who are not afraid to mention how they
    believe. At all times follow your heart.

  16. Hello to all, as I am truly eager of reading this website’s post to be updated on a regular basis.
    It consists of good material.

  17. Piece of writing writing is also a excitement, if you be acquainted with afterward you can write if not it
    is difficult to write.

  18. Every weekend i used to pay a quick visit this site, for the reason that i
    wish for enjoyment, since this this web site conations really good funny data
    too.

  19. This is very interesting, You’re a very skilled blogger.
    I have joined your rss feed and look forward to seeking more
    of your great post. Also, I have shared your site in my social networks!

  20. I’m really impressed with your writing skills and also with the
    layout on your weblog. Is this a paid theme or did you customize
    it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one today.

  21. Ahaa, its good conversation regarding this post here at this web site, I have read
    all that, so now me also commenting at this place.

  22. Its like you read my thoughts! You seem to understand so much about this,
    such as you wrote the e-book in it or something. I think that you
    simply could do with some % to pressure the message home a
    little bit, but instead of that, that is wonderful blog.

    An excellent read. I’ll certainly be back.

  23. Very good site you have here but I was wanting to know if you knew of any community forums that cover the same topics discussed in this article?
    I’d really like to be a part of community where I can get responses from other knowledgeable people that share the same interest.
    If you have any recommendations, please let me know. Cheers!

  24. Wonderful blog! I found it while searching on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Many thanks

  25. Pretty component to content. I just stumbled upon your website and in accession capital to
    claim that I acquire actually loved account your weblog posts.
    Any way I’ll be subscribing on your augment or even I success you access constantly
    quickly.

  26. Hi there! I just would like to offer you a huge thumbs up for the excellent information you’ve got
    here on this post. I am coming back to your web site
    for more soon.

  27. Ahaa, its good conversation on the topic of this article at this place at
    this web site, I have read all that, so at this time me also commenting at this place.

  28. Great post. I used to be checking continuously this weblog and I’m impressed!

    Extremely helpful information specifically the closing section 🙂 I maintain such information a
    lot. I used to be looking for this certain info for a long time.
    Thank you and best of luck.

  29. I am actually grateful to the holder of this web site who has shared
    this enormous article at at this time.

  30. Hello, I enjoy reading through your article. I wanted
    to write a little comment to support you.

  31. Does your blog have a contact page? I’m having a tough time locating it but, I’d like
    to shoot you an e-mail. I’ve got some suggestions
    for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it expand over time.

  32. Thank you for the auspicious writeup. It in fact was once a amusement account it.
    Glance complicated to more brought agreeable from you!
    However, how can we communicate?

  33. Excellent article. I’m going through some of these issues as
    well..

  34. Good info. Lucky me I ran across your site by chance (stumbleupon).
    I have saved as a favorite for later!

  35. Incredible! This blog looks exactly like my old one!

    It’s on a completely different topic but it has pretty much
    the same layout and design. Superb choice of colors!

  36. Thanks designed for sharing such a pleasant opinion, paragraph is good, thats
    why i have read it fully

  37. You really make it appear so easy along with your presentation but I to find this topic to be really one
    thing which I feel I would never understand. It sort of feels
    too complicated and extremely large for me. I am looking forward
    for your next submit, I’ll try to get the hang of
    it!

  38. What’s Taking place i’m new to this, I stumbled upon this I have discovered It
    absolutely helpful and it has aided me out loads.
    I am hoping to give a contribution & aid other customers like its helped me.
    Great job.

  39. Magnificent items from you, man. I’ve bear in mind your stuff prior to and you’re
    simply too fantastic. I really like what you’ve bought here, certainly like what you are saying and the way through which you assert
    it. You are making it enjoyable and you continue to take
    care of to stay it sensible. I cant wait to learn much more from you.
    That is actually a terrific web site.

  40. always i used to read smaller articles that also clear their motive, and that is also happening with this piece of writing which I am reading at this time.

  41. Hi, I do believe this is a great site. I stumbledupon it 😉 I may revisit yet again since I saved as a favorite it.
    Money and freedom is the greatest way to change, may you be rich
    and continue to help other people.

  42. Hey there superb website! Does running a blog similar to this
    require a lot of work? I’ve no understanding of coding but I
    was hoping to start my own blog in the near future. Anyway, if you
    have any recommendations or techniques for new blog owners please share.

    I understand this is off topic but I simply wanted to ask.
    Thanks!

  43. Hi there I am so grateful I found your blog,
    I really found you by accident, while I was researching on Aol for something else,
    Regardless I am here now and would just like to say
    many thanks for a incredible post and a all round thrilling blog (I also love the theme/design), I don’t have
    time to browse it all at the minute but I have book-marked it
    and also included your RSS feeds, so when I have time I will be back to
    read much more, Please do keep up the awesome jo.

  44. Thanks for finally writing about >Memory Management in Operating System | Technical Fan Windows 2019 <Liked it!

  45. Hi, I think your site might be having browser compatibility issues.
    When I look at your blog in Safari, it looks fine but when opening in Internet Explorer,
    it has some overlapping. I just wanted to give you a
    quick heads up! Other then that, great blog!

Leave a Reply

Your email address will not be published. Required fields are marked *