Search Unity

Too many open files

Discussion in 'iOS and tvOS' started by laurentlavigne, Mar 2, 2016.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    When building to iOS I am getting this odd error.
    What is this error about and how do I fix it?

     
  2. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    It seems that this is system specific issue as this is the first and the only report of this behavior. That is, the problem could be somewhere on your end.

    When the problem happens, could you check out what the "Activity monitor" says about Unity? Open the application, double click on the Unity row and navigate to the "open files and ports" panel. Copy the output and paste to the bug report you have submitted 775086.

    Thanks
     
  3. ToxinHeart

    ToxinHeart

    Joined:
    Oct 18, 2015
    Posts:
    5
    I am having the same problem when building on Mac:
    Snip20160929_1.png
     
  4. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Which version of Unity are you using?
     
  5. ToxinHeart

    ToxinHeart

    Joined:
    Oct 18, 2015
    Posts:
    5
    5.3.4f1
     
  6. farshidhss

    farshidhss

    Joined:
    Apr 4, 2015
    Posts:
    8
    I faced this error today as well! Unity crashed afterwards and I lost a ton of changes :/
     
  7. MegamiJadeheart

    MegamiJadeheart

    Joined:
    Jan 18, 2018
    Posts:
    1
    I have also been facing this the past two days, in Unity 2018.6, on Mac OS. While searching I found related issues with the Mac OS itself having a limiter on how many files can be open at any time, to prevent any given program from draining all the RAM. Since the Error Messages all list Unity Temp Files, and there are sometimes 10 messages in a row offering "Force Quit", "Cancel", and "Try Again" as options, I have to assume that Unity is opening so many temp files that it is running into MacOS's safeguard against memory leaks.

    There is apparently a way to increase the Limit in MacOS itself, only in Sierra10.12, but it is risky, and I do not think the OS safeguards should have to be modified when an application needs to maybe clean up after itself better?
     
  8. SolInvictus212

    SolInvictus212

    Joined:
    Aug 10, 2011
    Posts:
    50
    I'm getting "error CS0016: Could not write to file `Assembly-CSharp-firstpass'. Too many open files" when building, as of updating to Unity 2017.4.25.
     
  9. DanTaylor

    DanTaylor

    Joined:
    Jul 6, 2013
    Posts:
    119
    I managed to fix the "too many open files" issue by opening a console and typing the following before running Unity...
    • sudo su -root (Then enter password)
    • ulimit -n 2048 (This ups the file limit)
    • ulimit -a (a quick check to see if the limit has stuck)