当前位置:网站首页>Virtual address space
Virtual address space
2022-07-07 08:28:00 【Scroll_ C】
Virtual address space
- project
- 2021/11/27
Is this page helpful ?
When the processor reads or writes to a memory location , It uses a virtual address . During a read or write operation , The processor converts the virtual address to the physical address . Accessing memory through a virtual address has the following advantages :
Programs can use a series of contiguous virtual addresses to access discontinuous large memory buffers in physical memory .
A program can use a series of virtual addresses to access memory buffers larger than the available physical memory . When the supply of physical memory changes , The memory manager will put physical memory pages ( Usually the size is 4 KB) Save to disk file . Data or code pages move between physical memory and disk as needed .
Virtual addresses used by different processes are isolated from each other . Code in one process cannot change the physical memory being used by another process or operating system .
The range of virtual addresses available to a process is called the “ Virtual address space ” . Each user mode process has its own private virtual address space . about 32 Bit process , The virtual address space is usually 2 GB, Range from 0x00000000 to 0x7FFFFFFF. about 64 position Windows Upper 64 Bit process , The virtual address space is 128 TB, Range from 0x000'00000000 to 0x7FFF'FFFFFFFF. A series of virtual addresses is sometimes called a series “ Virtual memory ” . For more information , see also Memory and address space limitations .
This figure illustrates some important functions of virtual address space .

The figure shows two 64 Virtual address space of bit process :Notepad.exe and MyApp.exe. Each process has its own virtual address space , Range from 0x000'0000000 to 0x7FF'FFFFFFFF. Each shadow block represents a page of virtual memory or physical memory ( The size is 4 KB). Be careful ,Notepad Process use from 0x7F7'93950000 Three consecutive pages of the starting virtual address . However, these three consecutive pages of the virtual address will be mapped to discontinuous pages in physical memory . Attention, please. , Both processes use from 0x7F7'93950000 Start virtual memory page , But these virtual pages map to different pages of physical memory .
User space and system space
Such as Notepad.exe and MyApp.exe The process of runs in user mode . The core operating system components and multiple drivers run in a more privileged kernel mode . More about processor mode , see also User mode and kernel mode . Each user mode process has its own private virtual address space , But all code running in kernel mode is shared as “ System space ” A single virtual address space . The virtual address space of user mode processes is called “ User space ” .
stay 32 position Windows in , The total virtual address space available is 2^32 byte (4 GB). Usually , Lower 2 GB For user space , Higher 2 GB For system space .

stay 32 position Windows in , You can choose to specify ( When it starts ) exceed 2 GB Available in user space . As a result, less virtual addresses are available in the system space . You can increase the size of user space to 3 GB, under these circumstances , The system space is only 1 GB You can use . To increase the size of user space , Please use BCDEdit /set increaseuserva.
stay 64 position Windows in , The theoretical size of virtual address space is 2^64 byte (16 Ebyte ), But in fact, only 16 A small part of the byte range .
Code running in user mode can access user space , But you cannot access the system space . This restriction prevents user mode code from reading or changing protected operating system data structures . Code running in kernel mode can access user space , You can also access system space . namely , Code running in kernel mode can access the system space and the virtual address space of the current user mode process .
Drivers running in kernel mode must be very careful when reading or writing these addresses directly from user space addresses . This scheme explains the reason .
The user mode program initiates a request to read some data from the device . The program provides the starting address of the buffer to receive data .
The device driver routine running in kernel mode starts the read operation and returns control to its caller .
later , The device interrupts any currently running thread to show that the read operation is complete . Interrupt this arbitrary thread ( Belongs to any process ) Kernel mode driver routines running on .
here , The driver must not write data to the user mode program in step 1 The starting address provided in . This address is in the virtual address space of the process that initiated the request , This process is likely to be different from the current process .
Paging buffer pool and non paging buffer pool
In user space , All physical memory pages can be called out to disk files as needed . In system space , Some physical pages can be called , Other physical pages cannot . The system space has two areas for dynamically allocating memory : Paging buffer pool and non paging buffer pool .
The memory allocated in the paging buffer pool can be called out to disk files as needed . The memory allocated in the non paged buffer pool can never be called out to disk files .

边栏推荐
- Function extension, attribute extension and non empty type extension in kotlin
- Analysis of maker education in innovative education system
- [IELTS speaking] Anna's oral learning records Part3
- 如何理解分布式架构和微服务架构呢
- 利用 Helm 在各类 Kubernetes 中安装 Rainbond
- [quick start of Digital IC Verification] 11. Introduction to Verilog testbench (VTB)
- 数据中台落地实施之法
- Lua programming learning notes
- BiSeNet的特点
- 提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
猜你喜欢
随机推荐
解析机器人科技发展观对社会研究论
Train your dataset with swinunet
【Go ~ 0到1 】 第七天 获取时间戳,时间比较,时间格式转换,Sleep与定时器
Rainbow version 5.6 was released, adding a variety of installation methods and optimizing the topology operation experience
It's too true. There's a reason why I haven't been rich
一文了解如何源码编译Rainbond基础组件
Understanding of out covariance, in inversion and invariance in kotlin
漏洞复现-easy_tornado
Splunk查询csv lookup table数据动态查询
MES system is a necessary choice for enterprise production
Automatic upgrading of database structure in rainbow
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
Opencv learning note 4 - expansion / corrosion / open operation / close operation
数据中台落地实施之法
opencv学习笔记五——梯度计算/边缘检测
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
使用 Nocalhost 开发 Rainbond 上的微服务应用
Vulnerability recurrence easy_ tornado
Bisenet features









