我最近换用了 Ubuntu,但电脑性能出现了问题。在运行一些非常基本的任务(例如浏览和使用代码编辑器)时,系统会冻结(我也无法移动鼠标)。在运行硬件检查后,我发现我的旧硬盘已损坏。
我觉得这是死机的原因,于是我买了一个新的 SSD 并替换了笔记本电脑的硬盘。操作系统几乎立即启动,我对它的速度很满意。
然而,冻结现象仍然持续发生。我进行了内存测试,一切似乎都正常……有没有人遇到过类似的问题?
我厌倦了排除计算机故障,因为它在过去几个月中对我的生产力产生了负面影响。
以下是日志文件:
15:01:29 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:52:28 rtkit-daemon: Supervising 5 threads of 3 processes of 1 users.
14:51:40 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:47:57 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
14:47:45 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:45:25 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
14:43:52 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:42:54 systemd: fprintd.service: Succeeded.
14:42:45 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
14:42:43 gnome-shell: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
14:42:42 dbus-daemon: [session uid=1000 pid=878] Successfully activated service 'org.freedesktop.FileManager1'
14:42:42 nautilus: Failed to register: Unable to acquire bus name 'org.gnome.Nautilus'
14:42:42 dbus-daemon: [session uid=1000 pid=878] Successfully activated service 'org.gnome.Nautilus'
14:42:42 NetworkManager: <info> [1619005362.0201] agent-manager: agent[cb6596f52dd5ed9f,:1.40/org.gnome.Shell.NetworkAgent/1000]: agent registered
14:42:41 gdm-session-wor: gkr-pam: unlocked login keyring
14:42:24 systemd: Started Fingerprint Authentication Daemon.
14:42:24 dbus-daemon: [system] Successfully activated service 'net.reactivated.Fprint'
14:42:24 systemd: Starting Fingerprint Authentication Daemon...
14:42:24 dbus-daemon: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.40' (uid=1000 pid=1294 comm="/usr/bin/gnome-shell " label="unconfined")
14:39:41 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:35:34 avahi-daemon: Registering new address record for 2a02:587:350f:903a:df99:3302:6ded:38c5 on wlp2s0.*.
14:32:46 anacron: Normal exit (0 jobs run)
14:32:46 systemd: anacron.service: Succeeded.
14:31:22 whoopsie: [14:31:22] online
14:31:21 NetworkManager: <info> [1619004681.1227] manager: NetworkManager state is now CONNECTED_GLOBAL
14:31:20 whoopsie: [14:31:20] offline
14:31:20 systemd: Started Network Manager Script Dispatcher Service.
14:31:20 dbus-daemon: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
14:31:20 systemd: Starting Network Manager Script Dispatcher Service...
14:31:20 dbus-daemon: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.12' (uid=0 pid=654 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
14:31:20 NetworkManager: <info> [1619004680.6528] manager: NetworkManager state is now CONNECTED_SITE
14:31:11 wpa_supplicant: nl80211: send_and_recv->nl_recvmsgs failed: -33
14:30:02 cron: pam_unix(cron:session): session closed for user root
14:27:32 wpa_supplicant: wlp2s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-71 noise=9999 txrate=72200
14:17:01 cron: pam_unix(cron:session): session closed for user root
14:16:10 wpa_supplicant: wlp2s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-48 noise=9999 txrate=72200
13:54:45 gnome-shell: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
13:54:43 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
13:54:40 firefox: [GFX1-]: PCI candidate 0x1002/0x9874
13:54:39 systemd: Started Application launched by gnome-shell.
13:54:29 gnome-shell: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
13:54:28 systemd: gnome-launched-firefox.desktop-4615.scope: Succeeded.
13:53:43 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
13:53:35 firefox: [GFX1-]: PCI candidate 0x1002/0x9874
13:53:35 systemd: Started Application launched by gnome-shell.
13:52:59 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
13:52:57 dbus-daemon: [session uid=1000 pid=878] Successfully activated service 'org.gnome.ChromeGnomeShell'
13:52:55 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
13:52:54 firefox: [GFX1-]: PCI candidate 0x1002/0x9874
13:52:53 systemd: Started Application launched by gnome-shell.
13:52:49 rtkit-daemon: Supervising 4 threads of 2 processes of 1 users.
系统信息:
内存:5.5GB
处理器:AMD A12-9720p radeon r7,12 个计算核心 4c+8g x 4
显卡:AMD Radeon (tm) r7 m340 / AMD Radeon r7 graphics
磁盘容量:250GB
提前致谢。
答案1
对于 6G RAM,2G 的 /swapfile 太小了。
笔记:您可能需要添加更多 RAM。
在terminal
do中sysctl vm.swappiness
它应该返回 60(我们稍后可能会更改这个值)。
交换
让我们将您的 /swapfile 从 2G 增加到 4G...
笔记:错误使用rm
和dd
命令可能会导致数据丢失。建议复制/粘贴。
在里面terminal
...
sudo swapoff -a # turn off swap
sudo rm -i /swapfile # remove old /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile # set proper file protections
sudo mkswap /swapfile # init /swapfile
sudo swapon /swapfile # turn on swap
free -h # confirm 6G RAM and 4G swap
sudo -H gedit /etc/fstab
使用或编辑 /etc/fstab sudo pico /etc/fstab
。
确认 /etc/fstab 中的此 /swapfile 行...并确认没有其他“交换”行...在此行中使用空格...确认没有制表符...
/swapfile none swap sw 0 0
reboot # reboot and verify operation
更新#1:
“我进行了内存测试,一切似乎都很好”...刚刚成为“我之前尝试过运行 memtest,但无法完成。它在第 30 次循环左右冻结,没有发现任何问题”。
我们出现了问题。
AMD 处理器对 RAM 的要求非常严格,我们可能有一个不兼容的 SODIMM。进一步测试...
- 移除 2G SODIMM 并重新运行 memtest
- 移除 4G SODIMM 并重新插入 2G SODIMM 并重新运行 memtest