• zlg核心板linux系统中查看系统内存等使用信息


    1.查询系统状态的常用指令

    uname (查看操作系统的内核信息)

    Linux
    

    uname -a

    Linux EPC-M6G2C 4.1.15 #1 SMP PREEMPT Wed Oct 21 08:03:51 CST 2020 armv7l GNU/Linux
    

    uname -r

    4.1.15
    

    cat /proc/cpuinfo

    processor       : 0
    model name      : ARMv7 Processor rev 5 (v7l)
    BogoMIPS        : 24.00
    Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x0
    CPU part        : 0xc07
    CPU revision    : 5
    
    Hardware        : Freescale i.MX6 Ultralite (Device Tree)
    Revision        : 0000
    Serial          : 0000000000000000
    

    cat /proc/meminfo

    MemTotal:         249208 kB
    MemFree:          212680 kB
    MemAvailable:     220056 kB
    Buffers:               0 kB
    Cached:            12492 kB
    SwapCached:            0 kB
    Active:             7016 kB
    Inactive:          10024 kB
    Active(anon):       4592 kB
    Inactive(anon):      756 kB
    Active(file):       2424 kB
    Inactive(file):     9268 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    HighTotal:             0 kB
    HighFree:              0 kB
    LowTotal:         249208 kB
    LowFree:          212680 kB
    SwapTotal:             0 kB
    SwapFree:              0 kB
    Dirty:                 0 kB
    Writeback:             0 kB
    AnonPages:          4548 kB
    Mapped:             9728 kB
    Shmem:               800 kB
    Slab:               6636 kB
    SReclaimable:       2344 kB
    SUnreclaim:         4292 kB
    KernelStack:         400 kB
    PageTables:          300 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:      124604 kB
    Committed_AS:       8244 kB
    VmallocTotal:    1810432 kB
    VmallocUsed:        5496 kB
    VmallocChunk:    1628460 kB
    CmaTotal:          32768 kB
    CmaFree:           24072 kB
    

    hostname

    EPC-M6G2C
    

    free

                 total         used         free       shared      buffers
    Mem:        249208        36528       212680          800            0
    -/+ buffers:              36528       212680
    Swap:            0            0            0
    

    Mem 内存的使用信息
    buff/cache 被 buffer (缓冲区)和 cache (高速缓冲存储器)使用的物理内存大小
    Swap 交换空间的使用信息
    total 系统总的可用物理内存大小
    used 已被使用的物理内存大小
    free还有多少物理内存可用
    shared 被共享使用的物理内存大小
    available 还可以被使用的物理内存大小(即系统可用内存约等于free+shared+buff/cache)

    top   top查看进程运行情况 ( top -H -p 进程ID 查看线程运行情况)

    Mem: 36528K used, 212680K free, 800K shrd, 0K buff, 12492K cached
    CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
    Load average: 0.00 0.01 0.05 1/51 342
      PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
      237     1 root     S    34808  14%   0% ./mh3200cems -qws
      342   281 root     R     2096   1%   0% top
      151     1 root     S     2500   1%   0% /sbin/udevd -d
      185     1 dbus     S     2232   1%   0% dbus-daemon --system
      281     1 root     S     2096   1%   0% -sh
        1     0 root     S     1992   1%   0% init
      146     1 root     S     1992   1%   0% /sbin/syslogd -n
      149     1 root     S     1992   1%   0% /sbin/klogd -n
      215     1 root     S     1992   1%   0% /usr/sbin/telnetd -F
      204     1 root     S     1880   1%   0% /usr/sbin/dropbear -R
      225     1 root     S     1464   1%   0% /usr/local/webs/bin/webs
      175     1 daemon   S     1372   1%   0% portmap
       68     2 root     SW       0   0%   0% [irq/26-2040000.]
       19     2 root     SW       0   0%   0% [kworker/0:1]
      306     2 root     SW       0   0%   0% [kworker/0:0]
        7     2 root     SW       0   0%   0% [rcu_preempt]
        3     2 root     SW       0   0%   0% [ksoftirqd/0]
        6     2 root     SW       0   0%   0% [kworker/u2:0]
        2     0 root     SW       0   0%   0% [kthreadd]
       12     2 root     SW       0   0%   0% [kdevtmpfs]
    

    ps aux

    PID   USER     COMMAND
        1 root     init
        2 root     [kthreadd]
        3 root     [ksoftirqd/0]
        5 root     [kworker/0:0H]
    

    fdisk -l //看到的是物理磁盘大小(包括swap分区的物理大小)

    blk_update_request: I/O error, dev mtdblock0, sector 0
    blk_update_request: I/O error, dev mtdblock0, sector 0
    Buffer I/O error on dev mtdblock0, logical block 0, async page read
    
    Disk /dev/mtdblock1: 1 MB, 1048576 bytes
    255 heads, 63 sectors/track, 0 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock1 doesn't contain a valid partition table
    
    Disk /dev/mtdblock2: 8 MB, 8388608 bytes
    255 heads, 63 sectors/track, 1 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock2 doesn't contain a valid partition table
    
    Disk /dev/mtdblock3: 8 MB, 8388608 bytes
    255 heads, 63 sectors/track, 1 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock3 doesn't contain a valid partition table
    
    Disk /dev/mtdblock4: 4 MB, 4194304 bytes
    255 heads, 63 sectors/track, 0 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock4 doesn't contain a valid partition table
    
    Disk /dev/mtdblock5: 76 MB, 76546048 bytes
    255 heads, 63 sectors/track, 9 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock5 doesn't contain a valid partition table
    
    Disk /dev/mtdblock6: 165 MB, 165675008 bytes
    255 heads, 63 sectors/track, 20 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/mtdblock6 doesn't contain a valid partition table
    

    df -h //看到的是文件系统使用状况(不包括swap分区)

    Filesystem                Size      Used Available Use% Mounted on
    ubi0:rootfs              58.6M     52.5M      6.1M  90% /
    devtmpfs                105.4M         0    105.4M   0% /dev
    tmpfs                   121.7M         0    121.7M   0% /dev/shm
    tmpfs                   121.7M    632.0K    121.1M   1% /tmp
    tmpfs                   121.7M    164.0K    121.5M   0% /run
    ubi1_0                  134.7M     37.2M     92.9M  29% /opt
    

    cat /proc/version

    Linux version 4.1.15 (administrator@administrator-virtual-machine) (gcc version 4.9.2
    20140904 (prerelease) ( crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-
    2014.09) ) #1 SMP PREEMPT Wed Oct 21 08:03:51 CST 2020
    

    hostname(查看服务器名称)

    EPC-M6G2C
    
  • 相关阅读:
    机器学习15卷积神经网络处理手写数字图片
    机器学习12卷积神经网络
    机器学习11贝叶斯处理邮件分类问题------后续
    机器学习11贝叶斯处理邮件分类问题------待更新
    机器学习10贝叶斯
    机器学习9主成分分析
    机器学习7逻辑回归实践
    机器学习8特征选择
    机器学习6逻辑回归算法
    机器学习5线性回归算法
  • 原文地址:https://www.cnblogs.com/sggggr/p/15193710.html
Copyright © 2020-2023  润新知