Re: Will adding RAM help "No more memory available" error?

*To*: mathgroup at smc.vnet.net*Subject*: [mg89741] Re: Will adding RAM help "No more memory available" error?*From*: Bill Rowe <readnews at sbcglobal.net>*Date*: Thu, 19 Jun 2008 05:45:06 -0400 (EDT)

On 6/18/08 at 4:24 AM, enoel2 at gmail.com (Erin Noel) wrote: >I have a rather large program the imports data from excel >(approximately 600x200) and runs a monte carlo simulation on that >data. For large numbers of iterations, roughly about 5000, >Mathematica runs out of memory and returns the following error: >No more memory available. Mathematica kernel has shut down. Try >quitting other applications and then retry. >My question doesn't relate specifically to my code, which is why I >am not including any details of it. Generally speaking, will adding >RAM to the system help prevent this error? Are there any other >general methods for decreasing the likelihood of this error that >aren't code-specific? Simply put, you haven't supplied enough information to determine what is required to avoid the problem. The amount of RAM needed for a given problem depends both on the amount of data to be operated on and the code you use to preform the operation. For example consider the difference SparseArray can make. In[9]:= s = SparseArray[{{1, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 3} -> 4}, {50, 50}]; ByteCount[s] Out[10]= 704 In[11]:= m = Normal[s]; ByteCount[m] Out[12]= 10080 A simple Import of Excel files doesn't generate a SparseArray object. But using SparseArray may not give any benefit for you. It would depend on the data set and the operations you do. In general, more RAM will always help. But it is relatively easy to write code so that adding the maximum RAM possible for your system will not help.