当前位置:网站首页>How much memory can a program use at most?
How much memory can a program use at most?
2022-07-25 15:11:00 【weixin_ forty-two million seven hundred and nine thousand five 】
In virtual address mode , The memory capacity that a program can use is the same as the physical memory of the computer ( That is, your memory module ) It doesn't matter. , It is determined by the value range of the virtual address .
32 Bit operating system
stay 32 Bit operating system , The maximum memory a program can use is 4GB, That is to say 2 Of 32 Power . Even if your computer has 16G My memory module is useless , The rest 12G Can only be idle .
Let you buy so much memory , Waste it !
64 Bit operating system
stay 64 Bit operating system , Theoretically, the range of virtual addresses that can be accessed is 2^64.
It's a big value , It's almost infinite , In terms of current technology , Not only can the physical memory be so large ,CPU The addressing capability of is not so big , Realization 64 Bit long virtual addresses only increase the complexity of the system , No benefits .
Windows and Linux All have restrictions on virtual addresses , Use only the low address of the virtual address 48 position (6 Bytes ), The total virtual address size is 2^48 = 256TB.
256TB It's too big , Only in the age of quantum computer can we use so much memory !
The operating system also takes up memory
The operating system is also a program , And is the leader of other procedures , Always manage other programs , Whoever disobeys will be punished , Let him collapse .
conversely , Ordinary programs also need the help of the operating system , Especially when accessing hardware , For example, allocate memory 、 Open the file on the hard disk 、 Painting on the screen, etc .
The operating system and ordinary programs love and hate each other .
In order to achieve the purpose of love and hate , The operating system also takes up some memory .
32 Bit Windows Default occupation 4GB Medium 2GB, The program can only use the rest 2GB.
32 Bit Linux Default occupation 4GB Medium 1GB, The program can only use the rest 3GB.
64 Bit Windows Default occupation 256TB Medium 248TB, The program can only use the rest 8TB.
64 Bit Linux Default occupation 256TB Medium 128TB, The program can only use the rest 128TB.
Of course , The memory occupied by the operating system can be changed by setting .
In total , How much memory a program can use depends on the operating system , Different operating systems 、 Different digits will be different .
Now most of the operating systems we use are 64 It's a bit , Memory is enough , So if you are not short of silver , Just try to upgrade the memory , the more , the better , It won't be wasted .
边栏推荐
猜你喜欢

Nacos2.1.0 cluster construction

Raft of distributed consistency protocol

Melody + realsense d435i configuration and error resolution

Leo-sam: tightly coupled laser inertial odometer with smoothing and mapping

32 use of chrome debugging tools

用OpenPose进行单个或多个人体姿态估计

bridge-nf-call-ip6tables is an unknown key异常处理

"How to use" agent mode

树莓派入门:树莓派的初始设置

Realsense ROS installation configuration introduction and problem solving
随机推荐
outline和box-shadow实现外轮廓圆角高光效果
43 盒子模型
Thymeleaf notes
44 Sina navigation, Xiaomi sidebar exercise
vscode 插件篇收集
How to realize a correct double check locking
Award winning interaction | 7.19 database upgrade plan practical Summit: industry leaders gather, why do they come?
Handle Oracle deadlock
Visual Studio 2022 查看类关系图
我的创作纪念日
ESXI6.7.0 升级到7.0U3f(2022年7月12 更新)
Automatically set the template for VS2010 and add header comments
Solve the error caused by too large file when uploading file by asp.net
一个程序最多可以使用多少内存?
Sublimetext-win10 cursor following problem
oracle_12505错误解决方法
golang复习总结
处理ORACLE死锁
[thread knowledge points] - spin lock
树莓派入门:树莓派的初始设置