Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In general, I'd suggest setting maximum Java Heap Memory to about 25% of the available RAM, which allows you to open lots of figures (but not infinite numbers). If you cannot do this in the preferences (e.g. b/c you have a Mac like mine), <a href="http://www.mathworks.com/support/solutions/en/data/1-18I2C/" rel="nofollow noreferrer">this solution</a> will help - it overrides the preference settings.</p> <p>The linked solution also tells you how much free java memory you have left, and how much total is available: Run the following commands:</p> <pre><code>java.lang.Runtime.getRuntime.maxMemory java.lang.Runtime.getRuntime.totalMemory java.lang.Runtime.getRuntime.freeMemory </code></pre> <p>Unfortunately, a figure doesn't take a fixed amount of Java memory, an empty figure takes much less than one displaying 10k points, and a minimized figure takes less memory than a maximized one. However, if you can estimate the average memory needed per figure, you can indeed write a wrapper for <code>figure</code> that checks whether it's likely that this figure will be the last. Alternatively/additionally, you could make the wrapper function minimize all other figures (<a href="http://undocumentedmatlab.com/blog/minimize-maximize-figure-window/" rel="nofollow noreferrer">see Undocumented Matlab</a> for this).</p> <p><strong>EDIT</strong> As pointed out by <a href="https://stackoverflow.com/questions/6201272/how-to-avoid-matlab-crash-when-opening-too-many-figures/6201399#6201399">@Peter Lawrey</a>, you may also try and perform garbage collection before checking how much memory is available - though I don't know whether Matlab would try that, anyway.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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