当前位置:网站首页>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 .

边栏推荐
- Domain specific language / DSL in kotlin
- Full text query classification
- Opencv learning note 3 - image smoothing / denoising
- Open3D ISS关键点
- [paper reading] icml2020: can autonomous vehicles identify, recover from, and adapt to distribution shifts?
- eBPF Cilium实战(2) - 底层网络可观测性
- 【Go ~ 0到1 】 第七天 获取时间戳,时间比较,时间格式转换,Sleep与定时器
- [go ~ 0 to 1] obtain timestamp, time comparison, time format conversion, sleep and timer on the seventh day
- Iptables' state module (FTP service exercise)
- MES系统,是企业生产的必要选择
猜你喜欢

Opencv learning notes 1 -- several methods of reading images

Analysis of maker education in innovative education system

Bisenet features

PLSQL的安装和配置

Practice of combining rook CEPH and rainbow, a cloud native storage solution

GFS分布式文件系统

漏洞複現-Fastjson 反序列化

The truth of robot education in hands-on practice

Splunk query CSV lookup table data dynamic query

解读创客思维与数学课程的实际运用
随机推荐
【无标题】
Lua programming learning notes
Zcmu--1492: problem d (C language)
SSM 整合
How to understand distributed architecture and micro service architecture
使用 Nocalhost 开发 Rainbond 上的微服务应用
[untitled]
云原生存储解决方案Rook-Ceph与Rainbond结合的实践
打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
一文了解如何源码编译Rainbond基础组件
Openvscode cloud ide joins rainbow integrated development system
The single value view in Splunk uses to replace numeric values with text
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
在Rainbond中实现数据库结构自动化升级
The reified keyword in kotlin is used for generics
Rainbond结合NeuVector实践容器安全管理
Deit learning notes
Give full play to the wide practicality of maker education space
Offer harvester: add and sum two long string numbers (classic interview algorithm question)
Opencv learning note 4 - expansion / corrosion / open operation / close operation