V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
peterzhang0602
V2EX  ›  macOS

Too many open files in system 折磨死了

  •  
  •   peterzhang0602 · 2020-12-07 11:29:14 +08:00 · 2317 次点击
    这是一个创建于 1242 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    最好加个 alias,遇到了就执行一下
    peterzhang0602
        6
    peterzhang0602  
    OP
       2020-12-07 16:24:31 +08:00
    @Satelli 没有用
    cattyhouse
        7
    cattyhouse  
       2020-12-07 23:02:57 +08:00
    自己新建一个文件, 内容如下(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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2416 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 701ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.