setrlimit doesn't work on OS X Maverick and Yosemite

Iron-Eagle

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.

Iron-Eagle

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

pip doesn't work after upgrading to OS X Yosemite

From Dev

localhost doesn't execute php files after update to Maverick/Yosemite OS

From Dev

localhost doesn't work on Yosemite

From Dev

localhost doesn't work on Yosemite

From Dev

Go 1.6 does not work on OS X Yosemite

From Dev

OS X app that runs on 10.6 to 10.9 doesn't run on 10.10 (Yosemite) -- why?

From Dev

Importing request module in python doesn't work on OS X

From Dev

XAMPP 5.5.28 doesn't work on OS X 10.11

From Dev

Font Awesome doesn't work in MS Office on OS X 10.6

From Dev

Why doesn't isformula() work on Excel 2011 for OS X?

From Dev

why doesn't echo test &>>file work on OS X

From Dev

Keyboard shortcut for Service in OS X doesn't work

From Dev

Importing request module in python doesn't work on OS X

From Dev

install Fabric on virtualenv on mac os x Maverick

From Dev

Mounting with sshfs doesn't work after Yosemite upgrade

From Dev

Can't install Python-MySQL on OS X 10.10 Yosemite

From Dev

XAMPP won't start Apache on Mac OS X 10.10.3 Yosemite

From Dev

Can't start mongodb by launchctl on OS X Yosemite (10.10.2)

From Dev

Can't run Emulator in Android Studio for OS X Yosemite

From Dev

Parse OS X SDK doesn't work (and doesn't give any error)

From Dev

Set umask in OS X Yosemite

From Dev

Is there an alternative to Valgrind on OS X Yosemite?

From Dev

Porting CMake to OS X Yosemite

From Dev

sendmail in Mac OS X Yosemite

From Dev

Stack smashing on OS X Yosemite?

From Dev

OS X Yosemite Curl errors

From Dev

OS X Yosemite Spotlight extensions

From Dev

iReport not launching on OS X Yosemite

From Dev

Updating Openssl in os x yosemite

Related Related

HotTag

Archive