有时当我观看某个网站的视频时,视频和声音会卡在短暂的循环中,但我除了按住电源按钮关闭电脑外什么也做不了。知道会发生什么吗?我说的什么都没有,实际上是指什么都没有,包括切换到另一个终端。
我正在通过 syslog 挖掘更多信息,我希望它会有所帮助...但我不确定是否有真正的解决方案,因为日志:
Sep 5 19:04:00 orange-NB named[1062]: network unreachable resolving './NS/IN': 2001:500:2d::d#53
Sep 5 19:04:00 orange-NB named[1062]: network unreachable resolving './NS/IN': 2001:500:9f::42#53
Sep 5 19:04:00 orange-NB named[1062]: resolver priming query complete
Sep 5 19:04:42 orange-NB /usr/libexec/gdm-x-session[2452]: (EE) client bug: timer event8 tap: scheduled expiry is in the past (-3436ms), your system is too slow
Sep 5 19:05:11 orange-NB systemd-modules-load[287]: Inserted module 'lp'
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] microcode: microcode updated early to revision 0xea, date = 2021-01-05
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] Linux version 5.11.0-31-generic (buildd@lcy01-amd64-009) (gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.36.1) #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021 (Ubuntu 5.11.0-31.33-generic 5.11.22)
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.11.0-31-generic root=UUID=d7823b21-8e2b-498b-bf7b-a4e9125c5c23 ro quiet splash vt.handoff=7
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] KERNEL supported cpus:
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] Intel GenuineIntel
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] AMD AuthenticAMD
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] Hygon HygonGenuine
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] Centaur CentaurHauls
Sep 5 19:05:11 orange-NB kernel: [ 0.000000] zhaoxin Shanghai
包括一些消息,在这种情况下可以忽略网络错误,我没有 IPv6,我猜问题是 9 月 5 日 19:04:42 时的消息
$ free -h
total used free shared buff/cache available
Mem: 7,7Gi 2,5Gi 2,6Gi 43Mi 2,5Gi 4,8Gi
Swap: 2,0Gi 0B 2,0Gi
$ sysctl vm.swappiness
vm.swappiness = 60
从系统语言重命名:
$ swapon -s
File name Type Size Used Priority
/swapfile file 2097148 0 -2
$ ls -al /var/crash
total 12
drwxrwsrwt 2 root whoopsie 4096 zář 5 19:05 .
drwxr-xr-x 15 root root 4096 úno 14 2021 ..
-rw-r--r-- 1 orange whoopsie 0 zář 5 15:13 _opt_Qt_Tools_QtCreator_libexec_qtcreator_clangbackend.1000.upload
-rw------- 1 whoopsie whoopsie 37 zář 5 15:13 _opt_Qt_Tools_QtCreator_libexec_qtcreator_clangbackend.1000.uploaded
$ top
top - 22:07:08 up 3:02, 1 user, load average: 1,14, 1,45, 1,60
Tasks: 278 total, 1 running, 277 sleeping, 0 stopped, 0 zombie
%Cpu(s): 10,6 us, 7,1 sy, 0,0 ni, 82,1 id, 0,1 wa, 0,0 hi, 0,0 si, 0,0 st
MiB Mem : 7839,5 total, 2615,2 free, 2636,9 used, 2587,4 buff/cache
MiB Swap: 2048,0 total, 2048,0 free, 0,0 used. 4871,5 avail Mem
... (running aplications)
答案1
您的 /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 8G 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