How Virtual Memory Works
来源:互联网 发布:泄密数据库下载 编辑:程序博客网 时间:2024/05/20 02:52
http://www.howstuffworks.com/virtual-memory.htm
Virtual memory is a common part of most operating systems on desktop computers. It has become so common because it provides a big benefit for users at a very low cost.
In this article, you will learn exactly what virtual memory is, what your computer uses it for and how to configure it on your own machine to achieve optimal performance.
Most computers today have something like 32 or 64 megabytes of RAM available for the CPU to use (see How RAM Works for details on RAM). Unfortunately, that amount of RAM is not enough to run all of the programs that most users expect to run at once.
For example, if you load the operating system, an e-mail program, a Web browser and word processor into RAM simultaneously, 32 megabytes is not enough to hold it all. If there were no such thing as virtual memory, then once you filled up the available RAM your computer would have to say, "Sorry, you can not load any more applications. Please close another application to load a new one." With virtual memory, what the computer can do is look at RAM for areas that have not been used recently and copy them onto thehard disk. This frees up space in RAM to load the new application.
Because this copying happens automatically, you don't even know it is happening, and it makes your computer feel like is has unlimited RAM space even though it only has 32 megabytes installed. Because hard disk space is so much cheaper than RAM chips, it also has a nice economic benefit.
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 is when there's a slight pause when you're changing tasks. When that's the case, virtual memory is perfect.
When it is not the case, the operating system has to constantly swap information back and forth between RAM and the hard disk. This is calledthrashing, and it can make your computer feel incredibly slow.
The area of the hard disk that stores the RAM image is called a page file. It holdspages of RAM on the hard disk, and the operating system moves data back and forth between the page file and RAM. On a Windows machine, page files have a .SWP extension.
Next, we'll look at how to configure virtual memory on a computer
- How Virtual Memory Works
- How Virtual Table works in C++
- memory:How Memory Works: 10 Things Most People Get Wrong
- Detail about How VPTR and Virtual table works
- Detail about How VPTR and Virtual table works
- How JavaScript works: memory management + how to handle 4 common memory leaks
- How to Modify the Virtual Memory in a Mac
- virtual memory
- Virtual Memory
- Virtual Memory
- How SubString method works in Java - Memory Leak Fixed in JDK 1.7
- How Internet EDI Works
- How E-mail Works
- How E-mail Works
- How Google Works
- How DES works
- How Google Works
- How Google Map Works
- SQL语句
- Linux——查看磁盘信息
- OEA 中的业务控制器设计模式
- asp.net 中超链接的动态设置
- 为何使用NSLocalizedString
- How Virtual Memory Works
- OEA ORM中的分页支持
- OEA 中的多国语言实现
- OEA 中 WPF 树型表格整体重构
- ByteBuffer中实现方式
- phpcms v9中模板标签使用说明
- solaris11_64安装MongoDB
- Convert Sorted Array to Binary Search Tree - leetcode
- 小学生算数进位