AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1249916
Accepted
gigin26
gigin26
Asked: 2020-06-14 04:31:19 +0800 CST2020-06-14 04:31:19 +0800 CST 2020-06-14 04:31:19 +0800 CST

Ubuntu 在加载时间歇性冻结

  • 772

我在我的 MSI GF63 笔记本电脑上安装了 Ubuntu。我的规格如下: Intel Core i5 9300H(四核)8 GB RAM nVidia GTX 1050 Intel 660p 512GB SSD(140GB + 15GB Swap for Linux)

我的系统在加载时间歇性冻结。如果我播放音乐,运行 nodeJS 和 Java 服务器,打开 Firefox 和 VS Code。系统间歇性冻结。我尝试让 htop 保持运行以查看是否遇到任何瓶颈,但在这些情况下,我发现 CPU 和内存都没有耗尽容量。通常音频不会滞后,音乐和通话大部分都保持不变,即使有时它会有点卡顿,但鼠标不会移动,Alt + Tab 也不会工作

我尝试按照此处的建议安装 DRM KMS,但无济于事,我尝试切换到我的 nVidia GPU 使用 X-Server,但这也没有解决它。由于无法诊断出任何瓶颈,因此我几乎没有选择余地。

➜  ~ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.6G        6.5G        125M        573M        988M        270M
Swap:           15G        1.0G         14G
➜  ~ sysctl vm.swappiness
vm.swappiness = 60
➜  ~ grep -i swap /etc/fstab
# swap was on /dev/nvme0n1p6 during installation
UUID=a0c6ff2a-8e8c-428a-8ab6-37ca22bdb822 none            swap    sw              0       0

Gnome 扩展命令返回以下内容:

➜ ls -al /usr/share/gnome-shell/extensions         
total 16
drwxr-xr-x 4 root root 4096 Feb  3 23:54 .
drwxr-xr-x 6 root root 4096 Feb  3 23:54 ..
drwxr-xr-x 3 root root 4096 Feb  3 23:54 [email protected]
drwxr-xr-x 3 root root 4096 Feb  3 23:54 [email protected]
➜ ls -al ~/.local/share/gnome-shell/extensions     
ls: cannot access '/home/maverick/.local/share/gnome-shell/extensions': No such file or directory

重新启动时的最高输出

在没有过度负载的情况下观察到滞后时的最高输出

free -h在没有过度负载的情况下观察到滞后时的输出

              total        used        free      shared  buff/cache   available
Mem:           7.6G        2.5G        2.6G        394M        2.5G        4.5G
Swap:           15G        199M         15G

输出为lshw -C memory

sudo lshw -C memory
[sudo] password for maverick: 
  *-firmware                
       description: BIOS
       vendor: American Megatrends Inc.
       physical id: 1
       version: E16R3IMS.309
       date: 03/26/2020
       size: 64KiB
       capacity: 15MiB
       capabilities: pci upgrade shadowing cdboot bootselect edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification uefi
  *-memory
       description: System Memory
       physical id: 3b
       slot: System board or motherboard
       size: 8GiB
     *-bank:0
          description: SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
          product: M471A1K43CB1-CTD
          vendor: Samsung
          physical id: 0
          serial: 32E64524
          slot: ChannelA-DIMM0
          size: 8GiB
          width: 64 bits
          clock: 2667MHz (0.4ns)
     *-bank:1
          description: [empty]
          physical id: 1
          slot: ChannelB-DIMM0
  *-cache:0
       description: L1 cache
       physical id: 45
       slot: L1 Cache
       size: 256KiB
       capacity: 256KiB
       capabilities: synchronous internal write-back unified
       configuration: level=1
  *-cache:1
       description: L2 cache
       physical id: 46
       slot: L2 Cache
       size: 1MiB
       capacity: 1MiB
       capabilities: synchronous internal write-back unified
       configuration: level=2
  *-cache:2
       description: L3 cache
       physical id: 47
       slot: L3 Cache
       size: 8MiB
       capacity: 8MiB
       capabilities: synchronous internal write-back unified
       configuration: level=3
  *-memory UNCLAIMED
       description: RAM memory
       product: Cannon Lake PCH Shared SRAM
       vendor: Intel Corporation
       physical id: 14.2
       bus info: pci@0000:00:14.2
       version: 10
       width: 64 bits
       clock: 33MHz (30.3ns)
       capabilities: pm cap_list
       configuration: latency=0
       resources: memory:a441a000-a441bfff memory:a4422000-a4422fff
freeze msi 18.04
  • 1 1 个回答
  • 188 Views

1 个回答

  • Voted
  1. Best Answer
    heynnema
    2020-06-16T06:54:50+08:002020-06-16T06:54:50+08:00

    您冻结和滞后的原因是因为您的内存不足,并且系统正在交换。您正在运行很多进程,并在重新启动之前退出这些进程,从而解决了很多问题。内存和交换被回收,然后系统冻结/无延迟。

    数字版权管理系统

    撤消您的 DRM KMS 修改,因为它们没有解决问题。

    内存

    您需要将 RAM 从 8G 增加到 16G。您总是希望以相同大小、匹配的 RAM SODIMM 对配置内存,以便系统可以利用内存交错的速度优势。要配置您的内存,请添加另一个具有这些规格的 8G RAM SODIMM...

     description: SODIMM DDR4 Synchronous 2667 MHz (0.4 ns)
      product: M471A1K43CB1-CTD
      vendor: Samsung
      serial: 32E64524
      size: 8GiB
      width: 64 bits
    

    交换

    在增加 RAM 之后,我们将最后进行交换更改。

    您需要将交换分区从 16G 减少,我们会将您切换到 4G 的 /swapfile。完成后,您可以将 16G 交换分区分配给您的 / 或 /home 分区。

    注意:命令使用不当dd会导致数据丢失。建议复制/粘贴。

    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 16G RAM and 4G swap
    

    在 /etc/fstab 中注释掉这一行...

    UUID=a0c6ff2a-8e8c-428a-8ab6-37ca22bdb822 none            swap    sw              0       0
    

    将此行添加到 /etc/fstab...

    /swapfile    none    swap    sw      0   0
    

    重启。使用 .验证正确的 /swapfile 操作free -h。

    • 0

相关问题

  • 联想Z360有时不挂机,完全死机

  • 如果我运行除 root 以外的任何用户,为什么这个系统会冻结?(gdm、xdm、lxdm 等)[关闭]

  • 从清醒升级到特立独行后关机失败?[关闭]

  • 切换用户冻结桌面

  • 当 Ubuntu 死机时我该怎么办?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve