23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11 Improving Performance and Memory Usage<br />

http://support.microsoft.com/support/kb/articles/Q291/9/88.ASP<br />

Similarly, on machines running Windows Vista, you can achieve the same<br />

effect by using the command:<br />

BCDEdit /set increaseuserva 3072<br />

More documentation on this option can be found at the following URL:<br />

http://msdn2.microsoft.com/en-us/library/aa906211.aspx<br />

Compressing Data in Memory<br />

Since <strong>MATLAB</strong> uses a heap method of memory management, extended<br />

<strong>MATLAB</strong> sessions may cause memory to become fragmented. When memory<br />

is fragmented, there may be plenty of free space, but not enough contiguous<br />

memory to store a new large variable. If you get the Out of Memory message<br />

from <strong>MATLAB</strong>, the pack functionmaybeabletocompresssomeofyourdata<br />

in memory, thus freeing up larger contiguous blocks.<br />

Note Because of time considerations, you should not use pack within loops or<br />

M-file functions.<br />

Increasing System Swap Space<br />

How you set the swap space for your computer depends on what operating<br />

system you are running on.<br />

UNIX<br />

Information about swap space can be procured by typing pstat -s at the<br />

UNIX command prompt. For detailed information on changing swap space,<br />

ask your system administrator.<br />

Linux<br />

Swap space can be changed by using the mkswap and swapon commands. For<br />

more information on the above commands, type man followed by the command<br />

name at the Linux prompt.<br />

11-22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!