当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Sudo rosdep init error ROS installation problem solution

瀑布流布局

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

"Ask every day" reentrantlock locks and unlocks

反射-笔记

记一次Spark foreachPartition导致OOM

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

推荐10个堪称神器的学习网站

Award winning interaction | 7.19 database upgrade plan practical Summit: industry leaders gather, why do they come?

Yarn: the file yarn.ps1 cannot be loaded because running scripts is prohibited on this system.
随机推荐
API health status self inspection
[C topic] force buckle 876. Intermediate node of linked list
Object.prototype.hasOwnProperty() 和 in
When using jetty to run items, an error is reported: form too large or form too many keys
spark中saveAsTextFile如何最终生成一个文件
Scala110-combineByKey
As methods for viewing and excluding dependencies
Promise对象与宏任务、微任务
LeetCode_字符串_中等_151.颠倒字符串中的单词
如何解决Visual Studio中scanf编译报错的问题
Stored procedure bias of SQL to LINQ
Docker上运行redis以配置文件方式启动,连接客户端报错Error: Server closed the connection
[C topic] Li Kou 88. merge two ordered arrays
安装EntityFramework方法
[Nacos] what does nacosclient do during service registration
QT connect, signal, slot and lambda comparison
Spark002 --- spark task submission, pass JSON as a parameter
Fast-lio: fast and robust laser inertial odometer based on tightly coupled IEKF
树莓派入门:树莓派的初始设置
一个程序最多可以使用多少内存?