dantifer
V2EX  ›  macOS

推荐一个 macos 下的小工具 free

  •  
  •   dantifer · Dec 31, 2023 · 3516 views
  •   You need to sign in to view this topic
    This topic created in 929 days ago, the information mentioned may be changed or developed.

    哈哈,跟 linux 下面的 free 的作用一样

    虽然看起来很简单,但是在 macos 下还真没找着,只能自己写了一个

    https://github.com/zfdang/free-for-macOS

    见笑了

    10 replies    2026-04-28 01:23:55 +08:00
    i8k
        1
    i8k  
       Dec 31, 2023
    我很震惊,macos 如此精简吗?
    chendy
        2
    chendy  
       Dec 31, 2023
    啊? MacOS 没有 free ?
    啊,MacOS 有活动监视器有 istat 啊
    dantifer
        3
    dantifer  
    OP
       Dec 31, 2023
    @chendy 图形的 activity monitor 也可以啊,但是命令行貌似还真的没有...
    oxromantic
        4
    oxromantic  
       Dec 31, 2023
    值得赞赏,不过意义不大,mac 下你可以用 htop / atop / top 基本满足需求了
    FurN1
        5
    FurN1  
       Jan 1, 2024 via iPhone
    比较 UNIX 的方式是写一个 vm_stat 命令的 pipeline
    anonydmer
        6
    anonydmer  
       Jan 1, 2024
    vm_stat
    dantifer
        7
    dantifer  
    OP
       Jan 1, 2024
    @IgniteWhite 这个工具的方法,调用的是 vm_stat 使用的系统 api, 然后对结果进行细调,pipeline 有些实现起来还不太容易
    FurN1
        8
    FurN1  
       Jan 1, 2024
    @dantifer 哇,那您这个水平是高的!
    dantifer
        9
    dantifer  
    OP
       Jan 7, 2024
    还往大家能多给 github 点个关注,打算关注够了,就提交到 homebrew 官方的 formulae 里
    edwinjhlee
        10
    edwinjhlee  
       Apr 28
    我最近刚实现了一个。

    https://free.x-cmd.com/

    以下只是默认模式,专家模式提供更多 free -e

    $ free

    total used reusable
    Mem: 32.0 Gi 27.3 Gi 4.7 Gi (=purgeable + cache + available)
    Swap: 0 0 0


    hardware wired compressed app purgeable cache available
    Detail: 846.5 Mi 3.2 Gi 12.2 Gi 11.1 Gi 226.5 Mi 4.2 Gi 296.2 Mi (=free + throt)

    hardware wired compressed active inactive spec free throt
    vm_stat 846.5 Mi 3.2 Gi 12.2 Gi 7.8 Gi 7.7 Gi 3.9 Mi 296.2 Mi 0

    compressed original ratio saved
    12.2 Gi 24.2 Gi 50% 12.0 Gi

    Top 10 processes by MEM with --group auto

    MEM ELAPSED CNT PID COMMAND
    10.1 Gi 19-19:56:52 75 1340|1502|... /Applications/Visual Studio Code.app
    4.8 Gi 19-19:49:47 1 12342 /System/Library/Frameworks/Virtualization.framework/Versions/A/XPCServices/com.apple.Virtualization.VirtualMachine.xpc/Contents/MacOS/com.apple.Virtualization.VirtualMachine
    3.0 Gi 19-19:56:51 33 1343|1463|... /Applications/Google Chrome.app
    2.7 Gi 17-17:32:45 10 61831|1622|... claude
    1017.1 Mi 06-02:38:35 11 47978|48083|... /Applications/Firefox.app
    966.3 Mi 16:47:24 8 8901|65685|... /Applications/企业微信.app
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2810 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 13:03 · PVG 21:03 · LAX 06:03 · JFK 09:03
    ♥ Do have faith in what you're doing.