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

As methods for viewing and excluding dependencies

Raft of distributed consistency protocol

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

37 element mode (inline element, block element, inline block element)

Deployment and simple use of PostgreSQL learning

32 use of chrome debugging tools

Pl/sql creates and executes ORALCE stored procedures and returns the result set

Yarn: the file yarn.ps1 cannot be loaded because running scripts is prohibited on this system.

"Ask every day" briefly talk about JMM / talk about your understanding of JMM

SPI传输出现数据与时钟不匹配延后问题分析与解决
随机推荐
js URLEncode函数
41 picture background synthesis - colorful navigation map
MySQL之事务与MVCC
Add the jar package under lib directory to the project in idea
sql to linq 之存储过程偏
[C题目]牛客 链表中倒数第k个结点
"Ask every day" briefly talk about JMM / talk about your understanding of JMM
LeetCode第 303 场周赛
Realsense ROS installation configuration introduction and problem solving
Share a department design method that avoids recursion
基于OpenCV和YOLOv3的目标检测实例应用
Splice a field of the list set into a single string
6线SPI传输模式探索
oracle_12505错误解决方法
密码强度验证示例
图片的懒加载
pl/sql 创建并执行oralce存储过程,并返回结果集
Solve the error caused by too large file when uploading file by asp.net
[C题目]力扣88. 合并两个有序数组
Copy files / folders through Robocopy