在Window系统中如何让程序中访问3G虚拟地址

C++ : 1.虚拟地址 一.虚拟地址 1.1虚拟地址由来: 计算机发展两个阶段:实模式和保护模式 实模式:程序直接加载到内存。安全保护机制弱,恶意程序可通物理地址的跳转对正常程序恶意篡改 保护模式:程序不是直接加载到内存而是通虚拟地址空间映射到内存。此时为虚拟地址,跳转也是在虚拟地址范围内 1.2虚拟定义: 存在,看得见,它是物理的 存在,看不见,它是透明的 不存在,看得见,它是虚拟的 不存在,看不见,它被删除 1.3虚拟地址空间大小: 32位操作系统和64位区别:位指的是最大寻址能力,即计算机一次能处理的最大数据的比特位的个数 阅读详情

 除了在boot.ini文件中使用开关/3GB,还要在编译程序的时候使用/LARGEADDRESSAWARE,或者使用 Editbin.exe的工具。

 

 MSDN的文章:http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx。在这篇文章里面写的很清楚了,现贴在这里:

 

Memory Support and Windows Operating Systems

Updated: February 9, 2005

Operating systems based on Microsoft Windows NT technologies have always provided applications with a flat 32-bit virtual address space that describes 4 gigabytes (GB) of virtual memory. The address space is usually split so that 2 GB of address space is directly accessible to the application and the other 2 GB is only accessible to the Windows executive software.

The 32-bit versions of the Windows 2000 Advanced Server and Windows NT Server 4.0, Enterprise Edition, operating systems were the first versions of Windows to provide applications with a 3-GB flat virtual address space, with the kernel and executive components using only 1 GB. In response to customer requests, Microsoft has expanded the availability of this support to the 32-bit version of Windows XP Professional and all 32-bit versions of Windows Server 2003.

Windows 2000 Memory Support. With Windows 2000 Professional and Server, the maximum amount of memory that can be supported is 4 GB (identical to Windows NT 4.0, as described later in this section). However, Windows 2000 Advanced Server supports 8 GB of physical RAM and Windows 2000 Datacenter Server supports 32 GB of physical RAM using the PAE feature of the IA-32 processor family, beginning with Intel Pentium Pro and later.

Windows XP Professional and Windows Server 2003 Memory Support. The maximum amount of memory that can be supported on Windows XP Professional and Windows Server 2003 is also 4 GB. However, Windows Server 2003, Enterprise Edition supports 32 GB of physical RAM and Windows Server 2003, Datacenter Edition supports 64 GB of physical RAM using the PAE feature .

The virtual address space of processes and applications is still limited to 2 GB unless the /3GB switch is used in the Boot.ini file. When the physical RAM in the system exceeds 16 GB and the /3GB switch is used, the operating system will ignore the additional RAM until the /3GB switch is removed. This is because of the increased size of the kernel required to support more Page Table Entries. The assumption is made that the administrator would rather not lose the /3GB functionality silently and automatically; therefore, this requires the administrator to explicitly change this setting.

The /3GB switch allocates 3 GB of virtual address space to an application that uses IMAGE_FILE_LARGE_ADDRESS_AWARE in the process header. This switch allows applications to address 1 GB of additional virtual address space above 2 GB.

The virtual address space of processes and applications is still limited to 2 GB, unless the /3GB switch is used in the Boot.ini file. The following example shows how to add the /3GB parameter in the Boot.ini file to enable application memory tuning:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)/WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)/WINNT="????" /3GB

Note: "????" in the previous example can be the programmatic name of any of the following operating system versions:

Windows XP Professional
Windows Server 2003
Windows Server 2003, Enterprise Edition
Windows Server 2003, Datacenter Edition
Windows 2000 Advanced Server
Windows 2000 Datacenter Server
Windows NT Server 4.0, Enterprise Edition

Windows NT 4.0 Memory Support. With Microsoft Windows NT 4.0 Workstation and Server operating systems, the maximum amount of physical memory supported is 4 GB. The maximum amount of virtual memory is 2 GB.

With Windows NT 4.0 Server, Enterprise Edition, the /3GB switch was first added to Boot.ini.

Application Memory Tuning. This capability allows memory-intensive applications to utilize up to 50 percent more virtual memory on Intel-based computers. Application memory tuning provides more of the computer's virtual memory to applications by providing less virtual memory to the operating system.

Application Changes. No APIs are required to support application memory tuning. However, it would be ineffective to automatically provide every application with a 3-GB address space.

Executables that can use the 3-GB address space are required to have the bit IMAGE_FILE_LARGE_ADDRESS_AWARE set in their image header. If you are the developer of the executable, you can specify a linker flag (/LARGEADDRESSAWARE).

To set this bit, you must use Microsoft Visual Studio Version 6.0 or later and the Editbin.exe utility, which has the ability to modify the image header (/LARGEADDRESSAWARE) flag. For more information on setting this flag, see the Microsoft Visual Studio documentation.

Some manufacturers preconfigure their applications to use application memory tuning, making it unnecessary for you to make this change. For more information, see your application documentation and contact your application vendor to determine whether they support Large Address Awareness or whether you can enable it in their application.

Physical Address Extension. PAE is an Intel-provided memory address extension that enables support of up to 64 GB of physical memory for applications running on most 32-bit (IA-32) Intel Pentium Pro and later platforms. Support for PAE is provided under Windows 2000 and 32-bit versions of Windows XP and Windows Server 2003. 64-bit versions of Windows do not support PAE.

PAE allows the most recent IA-32 processors to expand the number of bits that can be used to address physical memory from 32 bits to 36 bits through support in the host operating system for applications using the Address Windowing Extensions (AWE) application programming interface (API). More information about the AWE API can be found at the MSDN Library .

4G虚拟地址空间分配 虚拟地址的分配: Linux:用户空间:内核空间 = 3:1 windows:用户空间:内核空间 = 2:2(虚拟地址低空间,即从0x00000000~0X7FFFFFFF的2GB为用户空间,而高地址0x80000000~0xFFFFFFFF被分配给了系统内核。) 图下研究的为Linux下的4G虚拟空间 接下来我们从上至下依次解释一下这些: 3G用户空间: 1、保留区 保留区1... 阅读详情

相关推荐

Windows内存管理(1)

Memory Management       内存管理器通过在虚拟内存空间提供一系列核心服务:内存映射文件,内存写时复制,大内存支持,以及一些底层的支持等来进行缓存管理。       内存管理来会涉及到的主题:       一、关于内存管理       二、内存管理函数的使用       三、内存管理参考手册       以下先重点讲理论和概念,结合代码使用,交叉穿插以及形象

行者无疆的专栏 1787

如何让32位.Net 应用打开3G开关

这种还在使用32位应用的场景大部分都是传统老的项目还在运行在很老的环境上,衷心希望这样长久的项目以后也越来越多(以后几百G的内存应该比比皆是了)。

蓝创精英团队 2113

让32位程序能申请到4GB内存方法

让32位程序能申请到4GB内存方法

使用LargeAddressAware压榨额外的用户态内存

一般情况下,无论在32位系统还是64位系统下,一个Win32用户进程可用的内存空间只有2GB少一点。那么,假设一个Win32程序内存不够用了,又不想(或者没办法)编译成X64的,怎么办呢,MS提供了一种方法,Linker中的LargeAddressAware参数。 启用它,可以获得额外的用户态内存。我在自己的X64系统下测试,如果没有启用,可以申请2GB不到;但是启动了这个参数,则可以申请将近4

^_^ 1万+

手把手教你用Kokoro-82M-v1.1-zh搭建本地TTS服务(含WebSocket接口)

本文详细介绍了如何使用Kokoro-82M-v1.1-zh模型搭建本地TTS服务,包括环境配置、模型部署、WebSocket接口实现及性能优化。通过实战指南,开发者可以快速掌握本地部署TTS系统的关键技术,提升语音交互应用的开发效率。

weixin_30776273的博客 183

不止于ACC:用CarSim的‘Multiple Objects’和路径跟踪器玩转复杂交通流场景

本文深入探讨了如何利用CarSim的'Multiple Objects'模块和路径跟踪器模拟复杂交通流场景,超越传统ACC测试的局限。通过批量控制、动态交互和参数化设计,实现多车智能响应和复杂轨迹模拟,适用于连续变道、拥堵博弈、匝道汇流等真实交通场景。

weixin_30954265的博客 497

LARGEADDRESSAWARE 标志技术细节详解

是一个 Windows 可执行文件(PE 文件)的标志,设置在 PE 文件头中,允许 32 位应用程序在 64 位 Windows 系统上访问更大的虚拟地址空间(从默认的 2GB 扩展到最大 4GB)。以下是对该标志的技术细节的深入解析,涵盖其工作原理、实现机制及相关注意事项。标志存储在 Windows 可执行文件(PE,Portable Executable)的。NuGet 包通过 MSBuild 任务自动化设置标志。如需更具体的实现代码、调试帮助或性能分析,请提供更多上下文!

专注于前沿技术的探索与实践,热衷于从代码逻辑、架构设计到行业应用等多维度深挖技术本质。期待在技术之路上与你共同成长~ 1154

OpenClaw Browser Relay Extension 鉴权失败与 invalid handshake 问题的终极解决方案

在使用 OpenClaw 浏览器插件 (Browser Relay Extension) 时,许多用户可能会遇到两个主要问题:一是配置端口错误导致的连接失败,二是鉴权失败 (Gateway token rejected)。本文将详细解析这两个问题并提供解决方案。

gerryke的blog 5559

聊聊LAA(LARGE ADDRESS AWARE)

博客搬到了fresky.github.io - Dawei XU,请各位看官挪步。最新的一篇是:聊聊LAA(LARGE ADDRESS AWARE)。 转载于:https://www.cnblogs.com/fresky/p/4599330.html

weixin_30477293的博客 1283

Windows下OpenMBEE项目MMS部署失败经历及改正

在Github里找到了上面的第一份文档,下载了MMS源代码(不知道为什么这个代码跟上面操作克隆得到的MMS代码不一样?好像是因为Gradle的版本问题,我本地之前已经安装过7.6.4的Gradle了,于是我找到gradle-wrapper.properties文件。后面在VScode中运行了一下依然是报这个错误,我在VScode终端直接执行。不知道为什么依然没什么用。打开“Windows PowerShell”。(如果是第一次运行它,将看到更长的输出)导航到要克隆存储库的文件夹,例如,

Yo_lan_da的博客 1869

DeepSeek-OCR 本地部署使用教程(附完整环境配置与推理示例)

DeepSeek-OCR是由DeepSeek AI推出的开源OCR模型,支持高精度文档识别与结构化输出(如Markdown转换)。本文提供了详细的本地部署指南,包括系统要求(推荐Linux+A100 GPU)、环境配置(Python 3.12.9+PyTorch 2.6.0+CUDA 11.8)、模型下载及两种推理方式:高性能的vLLM(适合批量处理)和灵活的Transformers(适合调试)。支持多种分辨率模式和提示词模板,适用于合同识别、PDF转换等场景。常见问题包括显存优化和性能调优建议。

qq_58607032的博客 6723

dotnetCampus.LargeAddressAware 详解

是一个 NuGet 包,由 dotnetCampus 团队开发(GitHub 仓库:https://github.com/dotnet-campus/dotnetCampus.LargeAddressAware)。它的主要作用是帮助 32 位 .NET 应用程序启用“Large Address Aware”(大地址感知)功能。背景知识在 Windows 系统中,32 位进程默认只能访问2 GB 的虚拟地址空间(用户模式下)。如果启用标志(通过 PE 文件头中的一个字节标志),32 位进程可以访问。

专注于前沿技术的探索与实践,热衷于从代码逻辑、架构设计到行业应用等多维度深挖技术本质。期待在技术之路上与你共同成长~ 1147

西门子200SMART PID温控实战:从配置到避坑(附加热棒控制案例)

本文详细介绍了西门子200SMART PLC在PID温控系统中的实战应用,涵盖硬件配置、PID参数整定及工程避坑技巧。通过加热棒控制案例,重点解析了信号处理、固态继电器选型、断电保持和无扰切换等关键问题,为工业自动化领域的温度控制提供可靠解决方案。

weixin_28727975的博客 356

虚拟地址空间布局

在多任务系统中,每个进程都运行在自己的虚拟地址空间上,32为模式下它是一个4G的内存地址块,在Linux系统下主要分为1G内核空间和3G用户空间,而在Windows系统下,内核空间和用户空间的划分比例为2:2. 在Linux系统下虚拟地址空间布局如下图所示: 位于虚拟地址空间最低部分为保留区,未赋予物理地址 .text 为代码段用来存放程序执行代码 .data段称为数据段,用来存放程序...

post_joke的博客 578

高分辨率航拍图像的目标检测切图优化策略

本文深入探讨了高分辨率航拍图像目标检测中的切图优化策略。针对大尺寸图像直接缩放导致小目标信息丢失的问题,文章详细阐述了基于重叠切割的核心方法,包括如何根据目标尺寸确定切图尺寸与重叠率,并提供了从切图到坐标还原的完整代码实现与避坑指南,有效提升检测精度与效率。

xk7n92h3p5m的博客 1113

[软考]系统架构设计师 备考经验分享(一) - 备考计划篇

前言 上周末刚刚结束了软考架构师的考试,自我感觉考的还可以,大概率是过了。 两次参加软考,一次中级嵌入式,一次高级架构师,都是备考不到两个月时间,尤其是架构师这次考试内容和本职工作有不小的差别,并且需要同时备考三个科目,在高强度地备考中感觉是摸索出到了一点软考的技巧与经验。 打算趁还记得,赶紧写几篇文章做下梳理总结,算是给将来自己考系分、高项或者其他考试做个记录,也希望能够帮到正在备考的大家。 先把第一步,个人的备考计划分享给大家。 自身情况分析 首先,请大家一定先明确三个问题,这三个问题会直接影响到你的

_ 6404

进程用户态虚拟地址空间上限测试

2013-05-04 wcdj 向青年节致敬! 问题:堆空间最大可以申请多少呢? 测试: // new_handler example #include // std::cout #include // std::exit #include // std::set_new_handler void no_memory (

delphiwcdj的专栏 1392

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

虚拟地址空间如何被划分

第十三章:第二节:一个虚拟地址空间如何被划分 摘自:http://blog.sina.com.cn/s/blog_4798d02d0100h4mk.html 虚拟地址空间如何被划分 每一个进程的虚拟地址空间被劈成几部分。被分区的地址空间基于底层操作系统的实现。分区改变很少的在不同的微软windows内核中。 显示每一个平台如何分区一个进程的地址空间。 分区 ...

Cgengzhihui的博客 700

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

4G虚拟地址空间

虚拟地址空间分布 对于每一个进程都会对应一个虚拟地址空间,对于32位的操作系统(其指令的位数最大为32位,因此地址码最多32位),虚拟地址空间的大小为2^{32}B即0~4GB的虚拟地址空间,其中内核空间为1GB,其他的3G属于用户空间如下所示: 0~3G的用户空间。从小到大(从下往上)依次为:保留区(受保护的地址)、代码段、数据段(.data段)、.bss段、堆空间、内存映射段、栈空间、命令行参数和环境变量。下面依次对每一个段做简单的介绍: 首先是用户空间: ①:128M大小的不可访问区域(保留区) 我

weixin_45009662的博客 882

【C++】4G虚拟地址空间

每一个进程都有自己的4G虚拟地址空间,一个页表项负责4K的地址空间和物理内存的映射,一个页有1024项,所以一个页负责4M的地址空间映射,一个页目录项对应一个页表,一个页目录有1024项,对应着1024个页表。所以一个进程有一个页目录,以页为单位保证4G的地址空间中的每一页和物理内存的映射。 在windows中4G虚拟地址空间分为低2G的用户空间和高2G的内核空间,在Linux系统中分为低3G的...

wAmber的博客 461

32位&64位版本Windows下运行win32程序扩展用户模式虚拟地址~

/3GB /3GB 在 32 位版本的 Windows 上,/3GB 参数启用 4 GT RAM 调节,该功能将用户模式虚拟地址空间放大到 3 GB 并将内核模式组建限制在剩余的 1 GB。     /3GB [ /userva=SizeInMB ]       子参数 /userva 为使用 /3GB 参数启

兴趣是最好的老师 1626

window server 2003

1.boot.ini 中对大内存的配置和管理 如何修改bootini文件的pae|awe|3gb参数 2008-01-03 09:30 如何修改bootini文件的pae|awe|3gb参数:大家都知道 boot.ini后面可以添加参数,诸如: PAE :使系统能够存取超过4GB的物理内存 3GB :使应用程序能够使用超过2GB的内存,最大3GB AWE ...

abc1104332737的博客 109

深入解析Windows操作系统(笔记7)

  32位的应用程序,开启大地址空间标志的情况下,在64位Windows系统可用4GB的内存空间(32位系统上最多达3G)。   内存管理器是Windows执行体的一部分(位于Ntoskrnl.exe中),主要由:   一组执行体系统服务,负责分配、释放和管理虚拟内存;   提供内存管理异常中的,转译无效陷阱处理器,以及访问错误陷阱处理器;   工作集管理器(优先级16),驻留在物理内存的部分称...

flukeshen的博客 2767

Exception of type 'System.OutOfMemoryException' was thrown.

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.] 在装有4G物理内存的32位OS机器上内存不足,原因是:The common language runtime throws an OutOfMemoryException error if it cannot allocate ph...

weixin_30339457的博客 906

可执行文件的装载于进程

6.1  进程虚拟地址空间       每个程序运行起来以后,它将拥有自己独立的虚拟地址空间,这个虚拟地址空间的大小由计算机的硬件平台决定,具体来说是由CPU的位数决定的     对于windows来说,它的进程虚拟地址空间划分是操作系统占用2GB,那么进程就只剩2GB空间。     windows有个启动参数可以将操作系统占用的虚拟地址空间减少到1GB,即跟Linux分布一样。方法

叶落无痕,枫过有情…… 1012

Windows/Linux内核地址空间管理的异同

相信很多人都知道Windows页表自映射一说,也晓得Linux内核的一一线性映射。然而很多人也仅仅就是知道而已,记住一个结论比理解一个原因要简单得多。        上周末,有人极具挑衅态度的问我能否分别用一句话描述它们,我承认我不是布道者,也难以说出”道可道,非常道“的玄语,但我十分赞同老子的观点,能说出来的道就不是大道,虽难以说出,但却可以解释,说到解释,那就是越详细越好了,冗长并不总是贬义

songwx479735228的专栏 1549
上一篇: VS中的"渐进式搜索"
下一篇: IIS下PHP的ISAPI和FastCGI比较
AI风
博客等级 码龄26年 25粉丝 35原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值