I work in company writing Audio Plugins for various programs, and currently I have the following problem with Logic on Os X Mavericks and Yosemite. Logic scans all our plugins, and, at some point it can no longer access the files. The errno is 24, meaning "Too Many Open Files"
We have the following roows in our code, that increase file descriptors available:
struct rlimit limit;
if (::getrlimit(RLIMIT_NOFILE, &limit) == 0)
{
limit.rlim_cur = (in_maxOpenFiles);
setrlimit(RLIMIT_NOFILE, &SetLimit);
}
And I also tried:
struct rlimit limit;
if (::getrlimit(RLIMIT_NOFILE, &limit) == 0)
{
limit.rlim_cur = (in_maxOpenFiles);
limit.rlim_max = (in_maxOpenFiles);
setrlimit(RLIMIT_NOFILE, &SetLimit);
}
Yet it did not help. The funny thing is, that if I open terminal, and run the following command:
ulimit -n 1024
and then I run the Logic from WITHIN the terminal everything is fine and there is no descriptor problems!!
Now, I thought that setrlimit is suppose to do the same as setrlimit, no? What am I doing wrong?
P.S. I also tried this solution: https://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks
It did not help.
I found the solution to my problem in this article eventually: http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/#Mac-OS-X
Here is also solution (For Maverick, not Yosemite): https://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks
However, it is still unclear why setrlimit fails. Probably OS X bug (Or feature).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments