peterzhang0602
V2EX  ›  macOS

Too many open files in system 折磨死了

  •  
  •   peterzhang0602 · Dec 7, 2020 · 3634 views
    This topic created in 2163 days ago, the information mentioned may be changed or developed.

    按照网上的各种教程 试了都不行,macOS bigsur 求解释,打开两三个 idea 几个软件 就提示

    7 replies  •  2020-12-07 23:02:57 +08:00
    bsfx2
    bsfx2
    Dec 7, 2020
    1
    试试通过 NVRAM 设置启动参数来打开服务器性能模式。
    https://support.apple.com/zh-cn/HT202528
    peterzhang0602
    peterzhang0602
    OP
    Dec 7, 2020
    2
    @Satelli 确定这开启么,笔记本啊😂
    riscv
    riscv
    Dec 7, 2020
    4
    ulimit -n 65535
    PerFectTime
    PerFectTime
    Dec 7, 2020
    5
    sudo launchctl limit maxfiles 64000 524288

    最好加个 alias,遇到了就执行一下
    peterzhang0602
    peterzhang0602
    OP
    Dec 7, 2020
    6
    @Satelli 没有用
    cattyhouse
    cattyhouse
    Dec 7, 2020
    7
    自己新建一个文件, 内容如下(cat /Library/LaunchDaemons/limit.maxfiles.plist):


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
    <string>launchctl</string>
    <string>limit</string>
    <string>maxfiles</string>
    <string>524288</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
    </dict>
    </plist>

    然后运行: 开机启动
    sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 20:03 · PVG 04:03 · LAX 12:03 · JFK 15:03
    ♥ Do have faith in what you're doing.