Note that there are some explanatory texts on larger screens.

plurals
  1. POMaximum amount of open files on iOS
    text
    copied!<p>How many files can we safely keep open in an iOS application?</p> <p>We are using FMOD to play audio in our game and apparently there a good strategy is to keep audio files pre-opened, but not loaded to memory, for rapid playback upon need.</p> <p>I did not find information about either per-process limits not global system wide limits in Apple's documentation, here on SO, or anywhere else.</p> <p>This quick test using a handy Python env on iPad suggests that the per-process limit is 250:</p> <p><img src="https://i.stack.imgur.com/LXIWU.jpg" alt="enter image description here"></p> <p>I think we stay below that limit. But we suspect that there is a rare problem situation where opening files fails.</p> <p>Is there also a system wide limit that can affect at some point?</p> <p>The per-app limit that I think I discovered with that test was asked in a comment in a related question but I can not comment there due to not having any reputation (first post): <a href="https://stackoverflow.com/questions/4083608/on-ios-iphone-too-many-open-files-need-to-list-open-files-like-lsof/">on iOS/iPhone: &quot;Too many open files&quot;: need to list open files (like lsof)</a></p> <p><strong>EDIT:</strong></p> <p>The limits are easy to check on OSX like this. Perhaps possible also on a jailbroken iOS device, or somehow from an app using Apple's API / launching that system command?</p> <pre><code>Tonis-MacBook-Pro:MacOS antont$ sysctl kern.maxfilesperproc kern.maxfilesperproc: 10240 Tonis-MacBook-Pro:MacOS antont$ sysctl kern.maxfiles kern.maxfiles: 12288 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload