Question

Compare virtual memory and segmentation, discuss how memory management schemes might affect programming paradigms.

Compare virtual memory and segmentation, discuss how memory management schemes might affect programming paradigms.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Affect of memory management in programming pardigms:

Memory management technique is to manage main memory in the computer which we can also called primary memory. Any application of computer, background it is completely a program. Every application program has to be run on main memory only. Computers should good at parallel executing of programs. For example, bacground some music app is running and we are working in browser meanwhile some amount of data is copying from one disk to other disk like this many programs we run parallely. All these programs normally sotred in secondary memory or called hard disk. Whenever we want to run an application, realted programs will be taken to main memory and executed there. What if have so many programs to run on main memory and main memory is not enogh space to run all those. When main memroy is full, then we feel that our computer is slow. That means efficiency or computer depends on the managing main memory. If we are not managing propelry then efficiency of computer will be decreased. To manage this main memory we use memory management techniques. Which take cares that which part of program is needed now, whcih is not needed so that no program will be effected. To achieve this memory management uses some algorithms and some techniques like virtual memory, paging, segmentation.Memory management is necessary in hardware, os, programs and applications..When a program requests a block of memory, memory manager will call allocation program and allocates what is necessary. And if a program finishes it's work, it deallocates the space. If there is no memory management in computer, computer works almost like human. Even it is doing a small task, it can't able to do other one. Because it many not have enough meory to run that. But if we have memory management, a part by part of big application code can be taken and necessasity will be managed effectively.

Virtual memory and segmentation:

* Virtual memory is a storage allocation technique where segmentation is memory management technique

* Virtual memory: Assume that we have a main memory of 2gb. But we have to runa an application which is of 4gb. Will computer say, I can't run? The answer is No. It can run the program. It stores the total application program in secondary memory and each time takes the part of programs to main memory which are in need that time and manages smoothly to run. But as a user you will think that computer has enough main memory to run application but actually it is'nt. This is exactly virtual memory (really that much memory does'nt exists). So here each time secondary memory can be addressed for specific part of code.

Let's see how segmentation is realte to virtual memory:

We know that some part of code everytime will be taken from secondary memory to main memory. When applications are running parallely part of codes from different different applications has to be taken into main memory. To manage this, virtual memroy follows some techniques like demand paging and segmentation.

In paging concept main memory divided into pages and application program also divided into pages where page is size of application program is equal to page size of main memory so that it can fit in main memory. Every time whaterver the page is required that will be takne into main memroy. This is demand paging.

In segmentation concept, main memory divided into segments. And application program also divided into segments. Each time a segment will be loaded into main meory.

Why segmentation is preferred than paging to achieve virtual memoy: Operating system will not look in user point of view while paging. That means, total program will be divided into pages, where each can be started at any line and end at any line. That means a single function which do a single useful work also can be divided into different pages. But in segmentation, prograrm will be divided at valid parts. Like main funciton into one segment all library functios into one segment. So it is vetter to have segmentation. There will be no internal frgmentation in segmentation.

Add a comment
Know the answer?
Add Answer to:
Compare virtual memory and segmentation, discuss how memory management schemes might affect programming paradigms.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT