I am running a pretty large optimization problem which actually consists of an outer an inner optmization problem. I use ParametricNDSolve for solving a ODE system. When the optimization is done, Mathematica uses almost all of my RAM memory. If I try Remove["Global`*"] the memory used is still the same.

Is there an easy way to check where the RAM in used?

  • $\begingroup$ Does setting $HistoryLength=0 help? $\endgroup$ – user21 Jun 6 '13 at 10:57
  • $\begingroup$ What happens when you quit the kernel? $\endgroup$ – Sjoerd C. de Vries Jun 6 '13 at 11:47
  • $\begingroup$ $HistoryLength=0 does not solve the issue..When I quiet the kernel the RAM used is decreased to the amount that is used when Mathematica is started. $\endgroup$ – jaclea Jun 9 '13 at 11:57

I used to have the same problem.

It would've helped if you had posted your code here. Anyways I had the same problem and I completely solved it by changing the method. try all of these methods see which one suits your problem more

  • TimeIntegration
  • BoundaryValues
  • DiscontinuityProcessing
  • EquationSimplification
  • IndexReduction
  • DAEInitialization
  • PDEDiscretization

Hope it will solve your problem.

  • $\begingroup$ The problems is pretty large, but I will try to create a small example to illustrate the problem.. I will take a deeper look at the methods you mentioned and see if it helps! $\endgroup$ – jaclea Jun 9 '13 at 11:57
  • $\begingroup$ I haven't found any solution to the problem above. Is anyone aware of problems with NDSolve and memory management? I call NDSolve inside a Module which is called several times during the optimization. When the optimization is done a large amount of memory has disappeared somewhere. It's not in the global context since I dont free up the memory when Removing the global context. $\endgroup$ – jaclea Feb 28 '14 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.