Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

18.04、16.04、14.04
回复
husthyx
帖子: 5
注册时间: 2020-04-03 9:36
系统: Ubuntu Server 18.04.
送出感谢: 0
接收感谢: 0

Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#1

帖子 husthyx » 2020-04-03 9:42

用笔记本作服务器用,4G物理内存,安装Ubuntu 18.04能使用的内存是3.6G,现在安装Ubuntu Server 18.04.4系统,4G物理内存只能用2.4G,这个问题该如何解决呀,请各位大牛帮忙解决,谢谢。以下是系统参数:

[email protected]:~# dmidecode|grep Size
Installed Size: 32 kB
Maximum Size: 32 kB
Installed Size: 32 kB
Maximum Size: 32 kB
Installed Size: 256 kB
Maximum Size: 256 kB
Installed Size: 2048 kB
Maximum Size: 2048 kB
Size: 4096 MB
Size: No Module Installed
Range Size: 4 GB
Range Size: 4 GB
Runtime Size: 128 kB
ROM Size: 8192 kB
Wrong DMI structures length: 2467 bytes announced, structures occupy 2473 bytes.



[email protected]:~# free -m
total used free shared buff/cache available
Mem: 2504 399 211 45 1893 1815
Swap: 2503 27 2476

[email protected]:~# cat /proc/version
Linux version 4.15.0-91-generic ([email protected]) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020

[email protected]:~# uname -a
Linux lenovo 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[email protected]:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
头像
astolia
论坛版主
帖子: 4602
注册时间: 2008-09-18 13:11
送出感谢: 1 次
接收感谢: 771 次

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#2

帖子 astolia » 2020-04-03 13:23

代码: 全选

dmesg | grep Memory
看剩下的是被什么占用了
husthyx
帖子: 5
注册时间: 2020-04-03 9:36
系统: Ubuntu Server 18.04.
送出感谢: 0
接收感谢: 0

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#3

帖子 husthyx » 2020-04-03 15:14

astolia 写了:
2020-04-03 13:23

代码: 全选

dmesg | grep Memory
看剩下的是被什么占用了
我用windows操作系统和BIOS时都显示是4G的物理内存。

[email protected]:/var/www/nextcloud# dmesg | grep Memory
[ 0.000000] Memory: 2501600K/2697132K available (12300K kernel code, 2481K rwdata, 4264K rodata, 2432K init, 2712K bss, 195532K reserved, 0K cma-reserved)
[ 0.033498] x86/mm: Memory block size: 128MB
[ 6.458713] [drm] Memory usable by graphics device = 2048M
头像
astolia
论坛版主
帖子: 4602
注册时间: 2008-09-18 13:11
送出感谢: 1 次
接收感谢: 771 次

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#4

帖子 astolia » 2020-04-03 19:47

再用

代码: 全选

dmesg | egrep -i 'BIOS|e820|reserve'
看看从bios来的内存分配情况
husthyx
帖子: 5
注册时间: 2020-04-03 9:36
系统: Ubuntu Server 18.04.
送出感谢: 0
接收感谢: 0

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#5

帖子 husthyx » 2020-04-03 19:49

该怎么弄才能让4G内存用足呢?请各位指教,谢谢。
husthyx
帖子: 5
注册时间: 2020-04-03 9:36
系统: Ubuntu Server 18.04.
送出感谢: 0
接收感谢: 0

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#6

帖子 husthyx » 2020-04-03 21:18

astolia 写了:
2020-04-03 19:47
再用

代码: 全选

dmesg | egrep -i 'BIOS|e820|reserve'
看看从bios来的内存分配情况
[email protected]:~$ dmesg | egrep -i 'BIOS|e820|reserve'
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009cfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009d000-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000020000000-0x00000000201fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000020200000-0x0000000040003fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000040004000-0x0000000040004fff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000040005000-0x000000008564ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000085650000-0x00000000dae9efff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000dae9f000-0x00000000daf9efff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x00000000daf9f000-0x00000000daffefff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000dafff000-0x00000000df9fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fe800000-0x00000000fe80ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fed08000-0x00000000fed08fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fed10000-0x00000000fed19fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ffc20000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011f5fffff] usable
[ 0.000000] SMBIOS 2.7 present.
[ 0.000000] DMI: LENOVO 20212/20212 , BIOS HCET03WW(1.03) 09/24/2012
[ 0.002753] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.002755] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.005510] DMA zone: 21 pages reserved
[ 0.029846] Calgary: detecting Calgary via BIOS EBDA area
[ 0.041619] Memory: 2470928K/2697132K available (14339K kernel code, 2387K rwdata, 4724K rodata, 2676K init, 5044K bss, 226204K reserved, 0K cma-reserved)
[ 0.096072] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in E820
[ 0.096072] mtrr: probably your BIOS does not setup all CPUs.
[ 0.375797] e820: reserve RAM buffer [mem 0x0009d000-0x0009ffff]
[ 0.375799] e820: reserve RAM buffer [mem 0x40004000-0x43ffffff]
[ 0.375800] e820: reserve RAM buffer [mem 0x85650000-0x87ffffff]
[ 0.375801] e820: reserve RAM buffer [mem 0x11f600000-0x11fffffff]
[ 0.392526] system 00:00: [io 0x06a4] has been reserved
[ 0.392532] system 00:00: [io 0x06a0] has been reserved
[ 0.392667] system 00:01: [io 0x0680-0x069f] has been reserved
[ 0.392672] system 00:01: [io 0x1000-0x100f] has been reserved
[ 0.392676] system 00:01: [io 0xffff] has been reserved
[ 0.392680] system 00:01: [io 0xffff] has been reserved
[ 0.392683] system 00:01: [io 0x0400-0x0453] has been reserved
[ 0.392687] system 00:01: [io 0x0458-0x047f] has been reserved
[ 0.392691] system 00:01: [io 0x0500-0x057f] has been reserved
[ 0.392694] system 00:01: [io 0x164e-0x164f] has been reserved
[ 0.392699] system 00:01: [mem 0xfe800000-0xfe80ffff] has been reserved
[ 0.392821] system 00:03: [io 0x0454-0x0457] has been reserved
[ 0.393152] system 00:06: [mem 0xfed1c000-0xfed1ffff] has been reserved
[ 0.393157] system 00:06: [mem 0xfed10000-0xfed17fff] has been reserved
[ 0.393161] system 00:06: [mem 0xfed18000-0xfed18fff] has been reserved
[ 0.393165] system 00:06: [mem 0xfed19000-0xfed19fff] has been reserved
[ 0.393169] system 00:06: [mem 0xf8000000-0xfbffffff] has been reserved
[ 0.393173] system 00:06: [mem 0xfed20000-0xfed3ffff] has been reserved
[ 0.393177] system 00:06: [mem 0xfed90000-0xfed93fff] has been reserved
[ 0.393181] system 00:06: [mem 0xfed45000-0xfed8ffff] has been reserved
[ 0.393185] system 00:06: [mem 0xff000000-0xffffffff] could not be reserved
[ 0.393189] system 00:06: [mem 0xfee00000-0xfeefffff] could not be reserved
[ 0.393193] system 00:06: [mem 0xfffff000-0xffffffff] has been reserved
[ 17.685210] thinkpad_acpi: ThinkPad BIOS HCET03WW(1.03), EC unknown
[ 18.699291] intel_rapl_common: RAPL package-0 domain package locked by BIOS
头像
astolia
论坛版主
帖子: 4602
注册时间: 2008-09-18 13:11
送出感谢: 1 次
接收感谢: 771 次

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#7

帖子 astolia » 2020-04-04 11:15

BIOS告诉系统只有以下内存区域可用

代码: 全选

0x0000000000000000-0x000000000009cfff		=     643071 字节
0x0000000000100000-0x000000001fffffff		=  535822335 字节
0x0000000020200000-0x0000000040003fff		=  534790143 字节
0x0000000040005000-0x000000008564ffff		= 1164226559 字节
0x0000000100000000-0x000000011f5fffff		=  526385151 字节
总共 2761867259 字节,也就是 2.57G 左右,系统再保留部分,就成了2.4G可用了

我查到这么一篇 https://forums.lenovo.com/t5/ThinkPad-L ... -p/1539272
说是如果设置为纯EFI启动,4G内存只会被保留很少部分,但如果设置为Legacy CSM启动,则至少会被BIOS保留1.4G。
你看一下是不是也是这种情况。
husthyx
帖子: 5
注册时间: 2020-04-03 9:36
系统: Ubuntu Server 18.04.
送出感谢: 0
接收感谢: 0

Re: Ubuntu Server 18.04.4,4G物理内存只能用2.4G。

#8

帖子 husthyx » 2020-04-04 11:52

astolia 写了:
2020-04-04 11:15
BIOS告诉系统只有以下内存区域可用

代码: 全选

0x0000000000000000-0x000000000009cfff		=     643071 字节
0x0000000000100000-0x000000001fffffff		=  535822335 字节
0x0000000020200000-0x0000000040003fff		=  534790143 字节
0x0000000040005000-0x000000008564ffff		= 1164226559 字节
0x0000000100000000-0x000000011f5fffff		=  526385151 字节
总共 2761867259 字节,也就是 2.57G 左右,系统再保留部分,就成了2.4G可用了

我查到这么一篇 https://forums.lenovo.com/t5/ThinkPad-L ... -p/1539272
说是如果设置为纯EFI启动,4G内存只会被保留很少部分,但如果设置为Legacy CSM启动,则至少会被BIOS保留1.4G。
你看一下是不是也是这种情况。

谢谢,问题解决了。
回复

回到 “LTS 长支持版”