Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Preventing swapping (high memory use)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99860] Preventing swapping (high memory use)
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Sat, 16 May 2009 05:22:18 -0400 (EDT)

Sometimes I don't realize how much memory a computation would take up 
(or I simply make a mistake, and start a calculation that requires too 
much memory), and my computer starts swapping.

This makes Mathematica (and often the OS too) completely unresponsive 
for a long time.  In this case my only hope is that in spite of the 
system unresponsiveness I can manage to kill the kernel, so that I can 
at least save the notebook ...

Is there any way to prevent swapping, for example by putting a cap on 
the kernel's memory use?  Even if the kernel just quits when it runs out 
of memory, I still have the notebook.  But if the computer gets so 
unresponsive that I have to restart it, then I lose the notebook too, 
which is a much more serious loss ...

I tried using MemoryConstrained (with $Pre), but it seems to constrain 
only the memory used by current computation, not the full kernel memory use.


To summarize:  I'm simply looking for a way to prevent the computer from 
locking up because of excessive swapping.


  • Prev by Date: Re: unrecognized USB devices
  • Next by Date: Re: Random choice
  • Previous by thread: 2D ray tracer
  • Next by thread: Re: Preventing swapping (high memory use)