Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I use NDSolve to solve a large set (~400) of coupled ODEs. Sometimes, the memory (~4GB) gets filled up, and my computer becomes impossible to work with, because it spends too much time writing to swap and the process can only be killed violently by the OS.

I circumvent this by using MemoryConstrained, but when the solver reaches the memory limit it is simply aborted and does not return the solution it obtained so far. Is there a way to obtain this solution (much like what happens when the solver encounters a singularity or reaches MaxSteps)?

Note: using a hack of the form

 StepMonitor :> If[MemoryInUse[]>...,...]

results in serious computational overhead.

share|improve this question
1  
Not wishing to be facetious, but if possible, I think it would be worthwhile to install more memory (or use a computer with more memory already installed). Personally I prefer to use Mathematica with a minimum of 8GB. – Oleksandr R. Dec 10 '12 at 11:54
3  
I'd love to know the answer to this. No matter how much memory I am given, I always manage to use it all up with Mathematica. – acl Dec 10 '12 at 12:25
3  
@OleksandrR. I have already ordered 16GB of RAM, but I think this problem is general and interesting enough to have a hardware-independent answer. – yohbs Dec 10 '12 at 12:35

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.