swarm-support
[Top][All Lists]
Advanced

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

Re: Memory leaks.


From: Vladimir Jojic
Subject: Re: Memory leaks.
Date: Tue, 27 Oct 1998 14:18:33 -0700 (MST)


Hi David,

Were there any actions scheduled for the currentTime+1 before you tried
to schedule the new one? 

If you try to schedule two or more actions for a particular point in time,
then they are placed in a concurrent group. Schedule than has only one
action (concurrentAction) scheduled for that point in time and this action
holds data about concurrent group.

Schedule relies on Collections library to count the number of actions in a
list, and does not investigate whether there are concurrentGroups
represented by concurrentActions in the Schedule. 

So, getCount only tells you how many points in time have scheduled
actions (but *not* the overall number of actions) ...

Cheers,
Vladimir

On Tue, 27 Oct 1998, David Sumpter wrote:

> 
> 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.
>                   ==================================
> 



                  ==================================
   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]