1
$\begingroup$

Is there a way to write the MemoryInUse into a file once a minute?

In this Debugging memory leaks question there is a neat dynamic diagram showing the MemoryInUse over time. My problem is that I run my mathematica script without the front-end (math -script mystuff.m) and it seems that Dynamic does not work.

$\endgroup$
  • $\begingroup$ Maybe PutAppend is the function you need. $\endgroup$ – Apple Mar 24 '14 at 10:04
4
$\begingroup$
(* make the task, fires once a minute *)
task = CreateScheduledTask[PutAppend[MemoryInUse[], "myMemory.log"], 60];

(* start the task *)
StartScheduledTask[task]

(* ... do your thingys ... *)

(* stop (or remove) the task *)
StopScheduledTask[task]

RemoveScheduledTask[task]
$\endgroup$

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.