MATLAB: Change .felix OSGi cache directory

.felix osgi figure tmp

When we use the figure command in Matlab there is a directory created called /tmp/.felix/ and our /tmp file system is very small so sometimes it fills up causing errors. Is there a way to direct Matlab to create that directory somewhere else?

Best Answer

I contacted support and was given a list of variables and properties that are checked in order for a valid place to put this cache along with some suggestions on how to set it up. Here is an excerpt from that response that gives the list: There are a few locations where MATLAB will try to create this cache, in order of precedence (where MATLAB will try the next option if the specified variable is not set or the location which it specifies is not writable by the user who is running MATLAB):
- Directory specified by environment variable TMPDIR
- Directory specified by environment variable TMP
- Directory specified by environment variable TEMP
- Directory specified by Java property java.io.tmpdir
- Directory specified by environment variable HOME
- Directory specified by Java property user.home
Changing the TMPDIR variable to a different path would resolve the issue. However I would not suggest doing that as it might temper with the other processes that use the /tmp to store the temporary files.
What I would suggest is setting this variable 'TMPDIR' only in a given MATLAB session. This can be don by setting this variable in "startup.m" and resetting it back in "finish.m".
Related Question