当前位置:网站首页>Bcdedit, used to adjust the machine startup parameters (safe mode, BootMenu display name, CPU, memory, etc.)

Bcdedit, used to adjust the machine startup parameters (safe mode, BootMenu display name, CPU, memory, etc.)

2022-06-23 21:33:00 shawyang

Conclusion first :bcdedit /set and bcdedit /deletevalue Need to restart to take effect

bcdedit /set parameter_name parameter_value

bcdedit /deletevalue parameter_name

truncatememory and removememory Do not set at the same time , Microsoft recommends setting removememory To achieve the purpose of reducing memory

Microsoft recommends bcdedit Command to adjust the power on vCPU Number and memory size ,msconfig Show incorrect problem bill of lading to Microsoft , Microsoft acknowledges yes bug, It is not planned to repair at present , Let go bcdedit Command to adjust

below 3 After the command is executed, restart the machine to restore the startup CPU、 Memory configuration

bcdedit /deletevalue numproc

bcdedit /deletevalue truncatememory

bcdedit /deletevalue removememory

【powershell】

bcdedit /deletevalue numproc 2>$nul 1>$nul

bcdedit /deletevalue truncatememory 2>$nul 1>$nul

bcdedit /deletevalue removememory 2>$nul 1>$nul

【cmd】

bcdedit /deletevalue numproc 2>nul 1>nul

bcdedit /deletevalue truncatememory 2>nul 1>nul

bcdedit /deletevalue removememory 2>nul 1>nul

If not executed bcdedit /set parameter_name parameter_value Is executed bcdedit /deletevalue parameter_name It will report an error or execute the 1 All over bcdedit /deletevalue parameter_name If you continue to repeat the execution after you have succeeded, an error will be reported , So the command adds output redirection to hide the error

bcdedit, It is used to adjust the startup parameters of the machine ( safe mode 、bootmenu The display name 、CPU、 Memory, etc. )

1、 Set the boot to enter safe mode

Reference resources https://cloud.tencent.com/developer/article/1917677

2、 Set up bootmenu The display name

Reference resources https://cloud.tencent.com/developer/article/1871412 The tail

3、 Set power on vCPU The maximum number

Reference resources https://cloud.tencent.com/developer/article/1922477

bcdedit /set numproc <number>

Set the maximum number of logical processors at startup ( such as 8vCPU You can set the boot time to use 4 individual vCPU)

bcdedit /set numproc 4

Execute the following command to restore

bcdedit /deletevalue numproc

4、 Set the maximum boot memory

The graphical interface "msconfig command → guide → Advanced options → Maximum memory " The maximum boot memory set in this way may not be the set value after reboot , Because there is hardware reserved memory .

https://docs.microsoft.com/zh-cn/windows-hardware/drivers/devtest/boot-parameters-to-manipulate-memory

As Microsoft official documents say , because removememory Option to use system memory more efficiently , It is therefore recommended to use it instead of truncatememory.

truncatememory or removememory Options in Windows 7 And later .Truncatememory Option ignores all memory at or above the specified physical address .removememory Options can be selected in a specified amount ( With MB In units of ) Reduce memory . Both options reduce memory , But when considering memory gaps ,removememory Option will better restrict the operating system from using the specified memory .

for example 64G Memory machine , Execute the following command to set the boot 4G Memory , When I actually entered the system, I found that... Was retained after startup 61G Memory , All that can be used is 3G Memory

( There are rounding elements here , The reality is that... Is reserved for the hardware 61.xG, What can be used is 2.yG,x+y=1)

bcdedit /set truncatememory 0x100000000

The above commands follow the graphical interface "msconfig command → guide → Advanced options → Maximum memory " This method has the same effect ( Want to be available 4G, Actually available only 3G), But the unit of graphical interface mode is MB.

truncatememory 0x500000000,20480M, Set up 20G, actual 19G

truncatememory 0x200000000,8192M, Set up 8G, actual 7G

truncatememory 0x100000000,4096M, Set up 4G, actual 3G

truncatememory 0x80000000,2048M, Set up 2G, actual 2G

truncatememory 0x40000000,1024M, Set up 1G, actual 1G

truncatememory 0x20000000,512M, Set up 0.5G, actual 0.5G

Execute the following command to restore

bcdedit /deletevalue truncatememory

use removememory You can also set the startup 4G Memory , With 64G Memory machine as an example , The order is as follows

# When n=64 when , cut down 60G、 Set the startup maximum 4G Memory , The algorithm is : Reduced memory = Total memory - Boot memory =1024*(n-4)=1024*60=61440

bcdedit /set removememory 61440

Execute the following command to restore

bcdedit /deletevalue removememory

Be careful :

removememory and truncatememory The units of numbers are different

removememory yes MB

truncatememory yes Byte

truncatememory and removememory Do not use at the same time

truncatememory and removememory Do not use at the same time

truncatememory and removememory Do not use at the same time

truncatememory and removememory There is one 1GB The difference of

64G Memory machine , Set power on 20G Memory 、8G Memory 、4G Memory 、2G Memory 、1G Memory 、512M Memory boot , The order is as follows

# When n=64 when , cut down 44G、 Set the startup maximum 20G Memory , The algorithm is : Reduced memory =1024*(n-20)=1024*44=45056

bcdedit /set removememory 45056

perform bcdedit /deletevalue removememory To restore

# When n=64 when , cut down 56G、 Set the startup maximum 8G Memory , The algorithm is : Reduced memory = Total memory - Available memory =1024*(n-8)=1024*56=57344

bcdedit /set removememory 57344

perform bcdedit /deletevalue removememory To restore

# When n=64 when , cut down 60G、 Set the startup maximum 4G Memory , The algorithm is : Reduced memory = Total memory - Available memory =1024*(n-4)=1024*60=61440

bcdedit /set removememory 61440

perform bcdedit /deletevalue removememory To restore

# When n=64 when , cut down 62G、 Set the startup maximum 2G Memory , The algorithm is : Reduced memory = Total memory - Available memory =1024*(n-2)=1024*62=63488

bcdedit /set removememory 63488

perform bcdedit /deletevalue removememory To restore

# When n=64 when , cut down 63G、 Set the startup maximum 1G Memory , The algorithm is : Reduced memory = Total memory - Available memory =1024*(n-1)=1024*63=64512

bcdedit /set removememory 64512

perform bcdedit /deletevalue removememory To restore

# When n=64 when , cut down 63.5G、 Set the startup maximum 0.5G Memory , The algorithm is : Reduced memory = Total memory - Available memory =1024*(n-0.5)=1024*63.5=65024

bcdedit /set removememory 65024

perform bcdedit /deletevalue removememory To restore

原网站

版权声明
本文为[shawyang]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112222349301449.html