Windows程序内存与Linux程序内存 [英] Windows Program Memory Vs Linux Program Memory

查看:118
本文介绍了Windows程序内存与Linux程序内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux为要使用的每个程序创建虚拟内存页面,并且OS负责将虚拟地址映射到真正的硬件地址,对吗?

但是Windows如何做到这一点? Windows程序实际上是否具有可转换为实际硬件地址的内存?我还知道,当RAM用完时,Windows可以使用硬盘内存,这个过程又称为虚拟内存,但是我相信这是一个完全不同的概念吗?

解决方案

Windows和Linux(至少在Intel 32/64位系统上)都使用相同的机制来实现虚拟内存:硬件支持的页表.操作系统和硬件共同协作以进行地址映射.

将程序使用的逻辑地址与物理地址分开的整个概念就是所谓的虚拟内存.将硬盘用作后备存储是一种虚拟内存的实现,该虚拟内存使用交换文件将虚拟内存的数量增加到大于系统中安装的物理内存的数量.

虚拟内存是一个非常广泛的主题.也许从这篇Wiki文章开始内存管理,然后在Google上进行更深入的了解.

Linux creates virtual memory pages for every program to use, and the OS handles mapping the virtual addresses to genuine hardware addresses, correct?

But how does Windows do this? Do Windows programs actually have memory that translates to real hardware addresses? I'm also aware that windows can use hard disk memory when RAM is over used, and this process is again called virtual memory, but I believe this is an entirely different concept?

解决方案

Windows and Linux (at least on Intel 32/64 bit systems) both implement virtual memory using the same mechanism: hardware supported page tables. The OS and the hardware cooperate together to do the address mapping.

The entire concept of separating the logical addresses a program uses from the physical addresses is what is called virtual memory. The use of the hard disk as a backing store is an implementation of virtual memory that uses a swap file to increase the amount of virtual memory to an amount greater than the physical memory installed in the system.

Virtual memory is a pretty deep and wide subject. Maybe start with this Wiki article an Memory Management and then hit the googles for a deeper understanding.

这篇关于Windows程序内存与Linux程序内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆