Ubuntu 比 Tortoise 慢

Ubuntu 比 Tortoise 慢

我安装 ubuntu 20.04 (64bit) 还不到一个半月。现在它变得像乌龟一样慢。它经常挂起。应用程序也崩溃了

在我的终端运行后,top以防你需要

y@MackbookPro:~$ top

top - 21:48:55 up 4 days,  6:22,  1 user,  load average: 0.76, 1.11, 1.63
Tasks: 234 total,   1 running, 233 sleeping,   0 stopped,   0 zombie
%Cpu(s): 14.1 us,  4.4 sy,  0.0 ni, 79.2 id,  0.6 wa,  0.0 hi,  1.7 si,  0.0 st
MiB Mem :   3804.6 total,    118.1 free,   2892.8 used,    793.6 buff/cache
MiB Swap:   2048.0 total,    317.7 free,   1730.3 used.    602.9 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                  
   1403 pronay    20   0 4521120 114116  40336 S  14.0   2.9  81:59.17 gnome-shell                                                              
  51842 pronay    20   0  413100  51088  38876 S   7.3   1.3   0:03.87 gnome-terminal-                                                          
   1264 pronay    20   0 3587844   8800   5436 S   2.0   0.2  24:56.36 pulseaudio                                                               
  14657 pronay    20   0 2949944 118612  52960 S   1.0   3.0  20:39.63 Web Content                                                              
   5991 pronay    20   0 4136964 393300 100156 S   0.7  10.1 114:35.70 firefox                                                                  
     11 root      20   0       0      0      0 I   0.3   0.0   1:57.73 rcu_sched                                                                
     18 root      20   0       0      0      0 S   0.3   0.0   0:07.29 ksoftirqd/1                                                              
  14703 pronay    20   0 5125348  31408  14760 S   0.3   0.8   5:48.28 code                                                                     
  14803 pronay    20   0 4590016  35108  15336 S   0.3   0.9   3:30.92 code                                                                     
  14877 pronay    20   0 1165444    120    120 S   0.3   0.0   1:32.62 cpptools                                                                 
  41626 pronay    20   0 2533508  70632  42444 S   0.3   1.8   1:24.99 Web Content                                                              
  49321 root      20   0       0      0      0 I   0.3   0.0   0:04.38 kworker/0:2-events                                                       
  49776 pronay    20   0 3204652 274696 136104 S   0.3   7.1   2:35.92 Web Content                                                              
  49990 root      20   0       0      0      0 I   0.3   0.0   0:02.21 kworker/u8:2-events_unbound                                              
  50304 root      20   0       0      0      0 I   0.3   0.0   0:01.66 kworker/1:2-events                                                       
  51854 pronay    20   0   20964   3976   3204 S   0.3   0.1   0:00.24 top                                                                      
  51863 pronay    20   0   20988   4000   3208 R   0.3   0.1   0:00.14 top                                                                      
      1 root      20   0  167804   5864   3568 S   0.0   0.2   0:23.03 systemd                                                                  
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.06 kthreadd                                                                 
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp                                                                   
      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp                                                               
      6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0H-kblockd                                                     
      9 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq                                                             
     10 root      20   0       0      0      0 S   0.0   0.0   0:08.13 ksoftirqd/0                                                              
     12 root      rt   0       0      0      0 S   0.0   0.0   0:00.58 migration/0                                                              
     13 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 idle_inject/0                                                            
     14 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/0                                                                  
     15 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/1                                                                  
     16 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 idle_inject/1                                                            

跑步后lscpu

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              1
Core(s) per socket:              2
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      21
Model:                           112
Model name:                      AMD A6-9200 RADEON R4, 5 COMPUTE CORES 2C+3G
Stepping:                        0
Frequency boost:                 enabled
CPU MHz:                         1458.383
CPU max MHz:                     2000.0000
CPU min MHz:                     1300.0000
BogoMIPS:                        3992.78
Virtualization:                  AMD-V
L1d cache:                       64 KiB
L1i cache:                       128 KiB
L2 cache:                        2 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, STIBP disabled, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx
                                  mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmper
                                 f pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c lahf_lm cmp_legacy svm ext
                                 apic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm perfctr
                                 _core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lb
                                 rv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmlo
                                 ad vgif overflow_recov

free

              total        used        free      shared  buff/cache   available
Mem:        3895912     2934976      565548       96732      395388      634288
Swap:       2097148     1856300      240848

uname -a

Linux MackbookPro 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
 *-firmware                
       description: BIOS
       vendor: Dell Inc.
       physical id: 0
       version: 1.8.0
       date: 03/01/2018
       size: 64KiB
       capacity: 8MiB
       capabilities: pci pnp upgrade shadowing cdboot bootselect edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int14serial int17printer acpi usb biosbootspecification netboot uefi
  *-cache:0
       description: L1 cache
       physical id: 17
       slot: L1 CACHE
       size: 160KiB
       capacity: 160KiB
       clock: 1GHz (1.0ns)
       capabilities: pipeline-burst internal write-back unified
       configuration: level=1
  *-cache:1
       description: L2 cache
       physical id: 18
       slot: L2 CACHE
       size: 1MiB
       capacity: 1MiB
       clock: 1GHz (1.0ns)
       capabilities: pipeline-burst internal write-back unified
       configuration: level=2
  *-memory
       description: System Memory
       physical id: 25
       slot: System board or motherboard
       size: 4GiB
     *-bank:0
          description: SODIMM DDR4 [empty]
          product: A1_PartNum0
          vendor: 000000000000
          physical id: 0
          serial: A1_SerialNum0
          slot: DIMM 0
          width: 64 bits
     *-bank:1
          description: SODIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: M471A5244BB0-CRC
          vendor: 009C360B0000
          physical id: 1
          serial: 124DE38B
          slot: DIMM 1
          size: 4GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)

RAM-4GB 处理器:AMD® A6-9200 radeon r4,5 个计算核心 2c+3g × 2

请帮我修复它。

答案1

交换

只有 4G RAM 和 Ubuntu,并且只有 2G 交换空间,因此没有足够的交换空间。

              total        used        free      shared  buff/cache   available
Mem:        3895912     2934976      565548       96732      395388      634288
Swap:       2097148     1856300      240848

笔记:您可能需要添加更多 RAM。

执行grep -i swap /etc/fstab,如果它报告“/swapfile”,则执行以下操作来增加您的/swapfile ...

笔记:错误使用rmdd命令可能会导致数据丢失。建议复制/粘贴。

在里面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 4G 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

相关内容