zoukankan      html  css  js  c++  java
  • mac上解决Resource temporarily unavailable

    Resource temporarily unavailable这种问题一般是因为当前的进程数或者文件数不够

    fork: Resource temporarily unavailable

    修改最大进程数

    我们可以通过ulimit -a来查看当前系统的一些系统参数。

     

    在上面这些参数中,通常我们关注得比较多的是一个进程可打开的最大文件数,即open files
    系统允许创建的最大进程数量即是max user processes 这个参数。

    maxproc表示的是开启的最大进程数,第一个1064表示的是soft限制,第二个1064表示的是hard限制,即硬件最大的限制数,自己设置的不能高于hard限制。所以 我soft也改成了1064最大的。

    maxfiles表示的是开启的最大文件数(句柄),意义同上……

    修改的方式如下

    打开或者新建一个文件:/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>65536</string>

              <string>65536</string>

            </array>

          <key>RunAtLoad</key>

            <true/>

          <key>ServiceIPC</key>

            <false/>

        </dict>

      </plist>

    保存并重启mac即可设置最大文件数。

    打开或者新建一个文件:/Library/LaunchDaemons/limit.maxproc.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.maxproc</string>

          <key>ProgramArguments</key>

            <array>

              <string>launchctl</string>

              <string>limit</string>

              <string>maxproc</string>

              <string>2048</string>

              <string>2048</string>

            </array>

          <key>RunAtLoad</key>

            <true />

          <key>ServiceIPC</key>

            <false />

        </dict>

      </plist>

    保存并重启mac即可设置最大进程数。

  • 相关阅读:
    水仙花数
    Edge browser hosts file
    tt0034583
    JavaScript中的面向对象
    滚动
    无缝滚动
    MySQL(一)
    JavaScript 精粹
    MYSQL新手入门篇
    用github来展示你的前端页面吧
  • 原文地址:https://www.cnblogs.com/liyy2015/p/6892758.html
Copyright © 2011-2022 走看看