peterzhang0602
V2EX  ›  macOS

Too many open files in system 折磨死了

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

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

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

    最好加个 alias,遇到了就执行一下
    peterzhang0602
        6
    peterzhang0602  
    OP
       Dec 7, 2020
    @Satelli 没有用
    cattyhouse
        7
    cattyhouse  
       Dec 7, 2020
    自己新建一个文件, 内容如下(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   ·   Solana   ·   1169 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 23:10 · PVG 07:10 · LAX 16:10 · JFK 19:10
    ♥ Do have faith in what you're doing.