How does Matlab use less memory after exceeding physical limit?

1 view (last 30 days)
I have a code which normally requires about 17 GB of memory, since there is a matrix which is about 12+ GB which is continually called using much smaller index matrices. However, when I run the code on a machine with 16 GB physical memory, MATLAB will reach this limit, then have some trouble for about 10 minutes, windows will freeze while appearing to writing data to the disk. But eventually MATLAB will continue running normally while only using about 4-6 GB memory. How does this happen? The code doesn't seem to be significantly slower. Has MATLAB written some kind of file which contains my large variable and somehow transfers are still fast even though I only have a normal HDD?
Since this continuous read from the HDD turns out to be reasonably fast in my code, how can I tell matlab to always do this with some huge variables, so that I can substantially increase the sizes of my matrices without freezing windows?
Thanks.

Answers (0)

Categories

Find more on Performance and Memory in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!