Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Maybe PutAppend is the function you need. –  Chenminqi Mar 24 at 10:04

1 Answer 1

up vote 4 down vote accepted
(* 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]
share|improve this answer

Your Answer

 
discard

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

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