swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory leaks.


From: David Sumpter
Subject: Memory leaks.
Date: Tue, 27 Oct 1998 19:52:23 GMT

Hi,

I am using Swarm v1.0.5 (but v1.1 is the same for what follows)

I have the following code which finds out how much memory is used by my Swarm 
program. I have identified that ALL leaks are due to this one line in my 
program 
where I put something into the schedule. But I can't see what can be wrong with 
it:

  sbrka = (int) (sbrk(0));
  s=[theSchedule getCount];

  // Line from program
  jb = [theSchedule at: currentTime+1 createActionTo: self message: M(doJob)];

  sbrkb = (int) (sbrk(0));
  if (sbrka!=sbrkb) {
  printf("\nMemory used before : %d Schedule:%d",sbrka,s);
  printf("\n                      after : %d  Schedule:%d",sbrkb,[theSchedule 
getCount]); 

The output is,

Memory used before : 5328576 Schedule:10
            after : 5336768  Schedule:10
            
Why is it that the count on the schedule doesn't increase but memory usage does?

Thanks,

David.            

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]