On Linux, you may occasionally encounter the error “dlopen: cannot load any more object with static TLS” in MATLAB. This is a known bug since way back!
To fix, create a file “startup.m” in the directory that you start MATLAB from with the following content:
ones(10)*ones(10);
I know! It’s ugly… But it works!!
EDIT: Since it was not clear, the folder that you start MATLAB from is by default “~/Documents/MATLAB” under Linux. On Windows, that would be “Documents\MATLAB”.
9 comments
Skip to comment form
I did this and restarted MATLAB and the problem went away. I don’t know whether it was this fix or restarting MATLAB that did it, but thanks one way or another. By the way, I think this solution is very elegant, not ugly in the least.
Author
Restarting MATLAB sometimes solves the problem. I’ve never encountered the issue again after doing this fix. Glad it worked for you as well.
Yeah restarting the Matlab did the job :))
Author
Without the fix, it will come back at some point. Trust me, I’ve been there 😉
Using MATLAB2014a. This does not solve the problem. Neither does repeatedly restarting MATLAB. Any other ideas?
Author
I tried this on MATLAB 2014a as well. Can you verify that your “startup.m” file is actually working? To test, modify it so that it would store the matrix in a variable (eg. A = ones(10)*ones(10);) and then check to see if A is defined when MATLAB has started.
When I was facing this issue, I looked around a lot and couldn’t find any other fix that worked for an extended period of time other than this.
Thank you very much ! It does works!
Author
Glad to hear that!
Thank you! It works.
I don’t know why, but it works.