# Heavy duty operations, RAM, and Readyboost

I occasionally work with large 3D arrays and found that with calculations that take a long time, Mathematica completely fills my available RAM (6056 MB minus other active operations [mostly svchost]), and so completely bogs down my pc that it takes minutes to even [alt][dot] abort evaluation, or do anything at all in a different program. At one point I was working with an active 4 GB 2.0 USB plugged in with readyboost, and it prevented my computer from freezing.

So my question, can I prevent Mathematica from freezing without the readyboost, and might upgrading to 8 GB RAM also solve the issue?

To be clear, it doesn't run out of memory, it just takes up all working memory for the duration of the computations. I'm not sure if readyboost also increases performance, I know people usually disregard it for any but the lowest performing computers, but it's a lifesaver here.

-
Unless you tell us what you were doing in Mathematica, there is no way to suggest a solution. There is no magic pill. However, from your description, it sounds like the issue is due to unpacking. Read: Are there guidelines for avoiding the unpacking of a packed array? –  rm -rf Dec 31 '13 at 1:49
It depends, one thing is where I use 4D arrays with the first three dimensions representing space. Subsequent calculations fill the 4th dimension as time. Like say start out with a gas density and over time it fills the room in a specific pattern. In this case every cell carries a value for the density. –  Feyre Dec 31 '13 at 2:12
Your machine is probably swapping, and ReadyBoost reduces the issue by putting most used files on Flash which doesn't suffer from physical disks' rotation and seek delays swapping causes when memory subsystem is "trashing." Problem should go away by having enough RAM to fit the working set completely in RAM. Also, using SSD drives in general could lessen the issue. –  kirma Dec 31 '13 at 5:18
6GB does not seem like a lot of memory these days (what system are you on?). Apart from @rm-rf´s advice, one simple thing to try is to set HistoryLength=0 and see if that helps (usually it does not). –  Yves Klett Dec 31 '13 at 7:20
Also consider using sparse arrays and/or MemoryConstrained, if these are adaptable to the specific problems you work on. –  Daniel Lichtblau Dec 31 '13 at 19:07