2

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.

Feyre
  • 8,597
  • 2
  • 27
  • 46
  • 1
    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 01: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 02:12
  • 1
    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 05:18
  • 1
    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 07: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
  • Sparse arrays aren't really an option. Doesn't MemoryConstrained just kill an active process? – Feyre Dec 31 '13 at 21:43
  • Actually sparse array could work for some instances, I'd have to add additional operations, but I could chop up some processes. Doesn't MemoryConstrained just kill an active process rhen it eats memory? Some of the arrays seem to be in excess of 6 GB, but even smaller ones cause the RAM to fill up completely. Good excuse to read up on packed arrays, but I'll try all advice. BTW full specs: Asus K73SV-TY128V – Feyre Dec 31 '13 at 22:01

0 Answers0