如何在不重装系统的前提下改变内存分区大小?
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
如何在不重装系统的前提下改变内存分区大小?
装系统的时候没搞懂直接让系统自动分配的内存,分了8G,实际我的物理内存只有4G。现在经常莫名其妙死机,我才是因为这个。
请问大神们这个该怎么改,如果流程复杂给个链接也成。
请问大神们这个该怎么改,如果流程复杂给个链接也成。
- qy117121
- 论坛版主
- 帖子: 50546
- 注册时间: 2007-12-14 13:40
- 系统: Winbuntu
- 来自: 志虚国乌由市
- 联系:
Re: 如何在不重装系统的前提下改变内存分区大小?
swap ?死机应该不是swap的关系
渠月 · QY
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu
Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用
邮箱 chuan@ubuntu.org.cn
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu
Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用
邮箱 chuan@ubuntu.org.cn
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
啊 我是小白不太懂,内存比物理内存大总不太好吧。关于死机,大多是在开了蓝{}灯、看个视频这种比较占内存的活动时才死的,而且是屏幕瞬间僵住,键盘鼠标都不管用,各种bash打不开只能强行断电。qy117121 写了:swap ?死机应该不是swap的关系
- tang.zhe
- 帖子: 1505
- 注册时间: 2010-07-15 13:31
Re: 如何在不重装系统的前提下改变内存分区大小?
火狐死机吗?
Ubuntu 命令技巧: http://wiki.ubuntu.org.cn/index.php?tit ... iant=zh-cn
Ubuntu 桌面指南: https://help.ubuntu.com//
Ubuntu 桌面指南: https://help.ubuntu.com//
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
chrome 开的标签少还好,一多就崩。有的时候没开浏览器,就是sudo apt-get update一下就死了。tang.zhe 写了:火狐死机吗?
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 如何在不重装系统的前提下改变内存分区大小?
把下面指令 複製 貼進終端機 執行装系统的时候没搞懂直接让系统自动分配的内存,分了8G,实际我的物理内存只有4G。现在经常莫名其妙死机,我才是因为这个。
1. sudo cat /etc/fstab | grep swap
2. sudo swapon -s
3. free -mt
4. sudo parted -l print
把結果全部直接 選取/複製/貼上來
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
poloshiao 写了:把下面指令 複製 貼進終端機 執行装系统的时候没搞懂直接让系统自动分配的内存,分了8G,实际我的物理内存只有4G。现在经常莫名其妙死机,我才是因为这个。
1. sudo cat /etc/fstab | grep swap
2. sudo swapon -s
3. free -mt
4. sudo parted -l print
把結果全部直接 選取/複製/貼上來
代码: 全选
$ sudo cat /etc/fstab | grep swap
# swap was on /dev/sda8 during installation
UUID=5ccf71bb-4c1a-4fd0-b3d1-420ed298598e none swap sw 0 0
$ sudo swapon -s
Filename Type Size Used Priority
/dev/sda8 partition 39997400 -1
$ free -mt
total used free shared buff/cache available
Mem: 7888 987 5341 447 1560 6168
Swap: 3905 0 3905
Total: 11794 987 9247
$ sudo parted -| print
Error: Could not stat device - - No such file or directory.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (.*?)}/ at /usr/bin/print line 528.
-
- 论坛版主
- 帖子: 5231
- 注册时间: 2007-01-14 16:23
Re: 如何在不重装系统的前提下改变内存分区大小?
出错的那个命令应该是 ,后面是小写L,不是竖线
你说的那个内存分区,和windows上的那个虚拟内存是类似的东西,比内存大很正常的事情
因为虚拟缓存导致死机似乎不太可能
代码: 全选
sudo parted -l
你说的那个内存分区,和windows上的那个虚拟内存是类似的东西,比内存大很正常的事情
因为虚拟缓存导致死机似乎不太可能
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 如何在不重装系统的前提下改变内存分区大小?
0. 你上面的描述 好像不正確 請查證装系统的时候没搞懂直接让系统自动分配的内存,分了8G,实际我的物理内存只有4G。现在经常莫名其妙死机,我才是因为这个。
1. 早期 物理内存只有幾百 MB 年代 要啟動程式 常常不夠 倒致當機 所以有 swap 到硬盤分割區的需求
1-1. 現在的電腦 RAM 常常是 幾 GB 啟動一般程式 不再會有這個困擾 導致 swap 分割區 備而不用
1-1. 查證一下 你的 物理内存只有 4G ? 還是 8GB ? (看一下 開機畫面 或 Bios 內顯示 RAM)free -mt
total used free shared buff/cache available
Mem: 7888 987 5341 447 1560 6168
1-2. 你的 RAM 還有 6.168 GB 空閒未使用
free -mt
total used free shared buff/cache available
Swap: 3905 0 3905
1-3. 你的 Swap 4GB 實際使用是 零 (因為 RAM 還有 6.168 GB 空閒未使用)sudo swapon -s
Filename Type Size Used Priority
/dev/sda8 partition 3,999,740 0 -1
2. 建議
2-1. 除非你跑高耗內存的程式 或 有休眠或冬眠 的設定 否則 把 Swap 暫時關閉 如下
2-2. 如果你真的想要設定 swap 分割區 早期說法至少是 RAM 兩倍 2x8=16 GB 以上 目前一般說法認為只要比 RAM 大一些 例如 1.2 倍即可 1.2x8=9.6 GB 以上/etc/fstab
# swap was on /dev/sda8 during installation
# UUID=5ccf71bb-4c1a-4fd0-b3d1-420ed298598e none swap sw 0 0
2-3. 對於 RAM 8 GB 來說 swap 4 GB 真的太小了 休眠或冬眠 可能會出現錯誤訊息或當機
2-4. 如果你不執行高耗內存的程式 或 有休眠或冬眠 的設定 可以嘗試學習把剩餘不用的 RAM 規劃其它用途 以提高工作效率
例如 ramdisk
2-4-1. https://zh.wikipedia.org/wiki/RAM_disk
RAM disk是通過使用軟體將RAM模擬當做硬碟來使用的一種技術。
2-4-2. https://en.wikipedia.org/wiki/RAM_drive
RAM drive
2-4-3. http://dchesmis.blogspot.tw/2016/05/ramdisk.html
在Ubuntu下建立RAMdisk,以加快網頁讀取速度
2-4-4. https://blog.longwin.com.tw/2006/01/ram ... ld_method/
拿 RAM 當硬碟來用(RAM Disk)
2-4-5. 需要一些進階知識 不建議新手躁進
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
我的问题我的问题,RAM确实是8G。
那我的电脑这样死机是什么原因呢
那我的电脑这样死机是什么原因呢
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 如何在不重装系统的前提下改变内存分区大小?
1. 死機原因 須看哪個階段死機经常莫名其妙死机
2. 優先檢查 顯卡驅動 是否合適安裝/設定/啟動
把下面指令 複製 貼進終端機 執行
2-1. uname -r
2-2. sudo lspci -knn
2-3. sudo lshw -numeric -class video
2-4. sudo ubuntu-drivers devices
把結果全部直接 選取/複製/貼上來
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
poloshiao 写了:1. 死機原因 須看哪個階段死機经常莫名其妙死机
2. 優先檢查 顯卡驅動 是否合適安裝/設定/啟動
把下面指令 複製 貼進終端機 執行
2-1. uname -r
2-2. sudo lspci -knn
2-3. sudo lshw -numeric -class video
2-4. sudo ubuntu-drivers devices
把結果全部直接 選取/複製/貼上來
代码: 全选
$ uname -r
4.8.0-44-generic
$ sudo lspci -knn
00:00.0 Host bridge [0600]: Intel Corporation Haswell-ULT DRAM Controller [8086:0a04] (rev 0b)
Subsystem: Microsoft Corporation Haswell-ULT DRAM Controller [1414:0a04]
Kernel driver in use: hsw_uncore
00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b)
Subsystem: Microsoft Corporation Haswell-ULT Integrated Graphics Controller [1414:0005]
Kernel driver in use: i915
Kernel modules: i915
00:03.0 Audio device [0403]: Intel Corporation Haswell-ULT HD Audio Controller [8086:0a0c] (rev 0b)
Subsystem: Intel Corporation Haswell-ULT HD Audio Controller [8086:0a0c]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:14.0 USB controller [0c03]: Intel Corporation 8 Series USB xHCI HC [8086:9c31] (rev 04)
Subsystem: Microsoft Corporation 8 Series USB xHCI HC [1414:9c31]
Kernel driver in use: xhci_hcd
00:16.0 Communication controller [0780]: Intel Corporation 8 Series HECI #0 [8086:9c3a] (rev 04)
Subsystem: Microsoft Corporation 8 Series HECI [1414:9c3a]
Kernel driver in use: mei_me
Kernel modules: mei_me
00:1b.0 Audio device [0403]: Intel Corporation 8 Series HD Audio Controller [8086:9c20] (rev 04)
Subsystem: Microsoft Corporation 8 Series HD Audio Controller [1414:9c20]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 3 [8086:9c14] (rev e4)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1f.0 ISA bridge [0601]: Intel Corporation 8 Series LPC Controller [8086:9c43] (rev 04)
Subsystem: Microsoft Corporation 8 Series LPC Controller [1414:9c43]
Kernel driver in use: lpc_ich
Kernel modules: lpc_ich
00:1f.2 SATA controller [0106]: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] [8086:9c03] (rev 04)
Subsystem: Microsoft Corporation 8 Series SATA Controller 1 [AHCI mode] [1414:9c03]
Kernel driver in use: ahci
Kernel modules: ahci
00:1f.3 SMBus [0c05]: Intel Corporation 8 Series SMBus Controller [8086:9c22] (rev 04)
Subsystem: Microsoft Corporation 8 Series SMBus Controller [1414:9c22]
Kernel modules: i2c_i801
01:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless [11ab:2b38]
Subsystem: SafeNet (wrong ID) 88W8897 [AVASTAR] 802.11ac Wireless [0001:045e]
Kernel driver in use: mwifiex_pcie
Kernel modules: mwifiex_pcie
$ sudo lshw -numeric -class video
*-display
description: VGA compatible controller
product: Haswell-ULT Integrated Graphics Controller [8086:A16]
vendor: Intel Corporation [8086]
physical id: 2
bus info: pci@0000:00:02.0
version: 0b
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:45 memory:c0000000-c03fffff memory:b0000000-bfffffff ioport:3000(size=64) memory:c0000-dffff
$ sudo ubuntu-drivers devices
== cpu-microcode.py ==
driver : intel-microcode - distro non-free
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 如何在不重装系统的前提下改变内存分区大小?
1. viewtopic.php?p=3188300#p3188300sudo lshw -numeric -class video
*-display
description: VGA compatible controller
product: Haswell-ULT Integrated Graphics Controller [8086:A16]
... 省略
configuration: driver=i915 latency=0
2. Ubuntu 預設桌面 原名稱 Unity 桌面
Ubuntu 16.04 的 Unity 需要良好的 3D 支援
但是 i915 對於 Haswell-ULT 3D 支援可能不夠好
3. 建議 另外安裝 gnome-session-flashback 桌面 對於 3D 不要求
3-1. http://packages.ubuntu.com/xenial/gnome ... -flashback
3-2. http://www.debugpoint.com/2016/04/insta ... ing-unity/#
4. 或者 安裝 Lubuntu / Xubuntu / Ubuntu Mate
-
- 帖子: 7
- 注册时间: 2017-04-05 11:36
- 系统: Ubuntu Desktop 16.04
Re: 如何在不重装系统的前提下改变内存分区大小?
poloshiao 写了:1. viewtopic.php?p=3188300#p3188300sudo lshw -numeric -class video
*-display
description: VGA compatible controller
product: Haswell-ULT Integrated Graphics Controller [8086:A16]
... 省略
configuration: driver=i915 latency=0
2. Ubuntu 預設桌面 原名稱 Unity 桌面
Ubuntu 16.04 的 Unity 需要良好的 3D 支援
但是 i915 對於 Haswell-ULT 3D 支援可能不夠好
3. 建議 另外安裝 gnome-session-flashback 桌面 對於 3D 不要求
3-1. http://packages.ubuntu.com/xenial/gnome ... -flashback
3-2. http://www.debugpoint.com/2016/04/insta ... ing-unity/#
4. 或者 安裝 Lubuntu / Xubuntu / Ubuntu Mate
好的 感谢耐心帮助!!