Exploring My Technical Learnings... Which could be a doubt or solution..!
Sunday, March 28, 2010
What is Virtual Memory?
Initially, when i heard aboout Virtual Memory, i knew that 'all current running data will in RAM. From RAM only, processor get the data. Hence addresses for those data will be different in Secondary memory (Hard Disk) and RAM. Virtual Memory hides these information ie., it converts the actual address to RAM address and vice versa.
But when, fortunately(?), I saw one document about Virtual Memory some days back, i came to know that i was wrong about Virtual Memory. Immediately i took a small note on Virtual Memroy and decided to put on my blog.
Virtual Memory:
Most computers today have 2 to 4GB of RAM available. Often, that amount of RAM is not enough to run all of the programs. For example, if you load the Windows operating system, an e-mail program, a Web browser and word processor into RAM simultaneously, RAM would not be able to hold it all.
With virtual memory, the computer can look for areas of RAM that have NOT been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application. Because it does this automatically, you don't even know it is happening, and it makes your computer feel like is has unlimited RAM space.
The area of the hard disk that stores the RAM image is called a page file. It holds pages of RAM on the hard disk, and the operating system moves data back and forth between the page file and RAM. (files have a .SWP extension.)
Of course, the read/write speed of a hard drive is much slower than RAM, and the technology of a hard drive is not geared toward accessing small pieces of data at a time. If your system has to rely too heavily on virtual memory, you will notice a significant performance drop. The key is to have enough RAM to handle everything you tend to work on simultaneously. Then, the only time you "feel" the slowness of virtual memory is in the slight pause that occurs when you change tasks. When you have enough RAM for your needs, virtual memory works beautifully. When you don't, the operating system has to constantly swap information back and forth between RAM and the hard disk. This is called thrashing, and it can make your computer feel incredibly slow.
----- * -----
I had some questions on this Virtual Memory when i attended interviews. Swapping functions (call by value/call by reference) will be useful in this context. That day only, made me to know about Virtual Memory.
Interviews are not only for changing the company. They also help us a lot to improve our thought process and make us realize about how much we know about the things.
Have a great life...
Subscribe to:
Posts (Atom)