[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Swarm-Support] memory problems
From: |
Marcello |
Subject: |
[Swarm-Support] memory problems |
Date: |
03 Jun 2003 15:24:42 +0200 |
Hi,
I have a swarm piece in Object C. It does everything using about 1% of
my 512mg of memory. Now I added one EZDistribution to each Agent (which
is a SwarmObject). The idea is that each agent creates a list of other
agents, passes it through a EZDistribution to get some statistics and
drop everything right after (see code). The problem is that when this
piece of code is in the program, the program sucks up a large amount of
memory, something like 5% of the memory each 100 calls to agents
(according to "top").
After some checks I know is the EZDistribution that creates the memory
problem, but I do not know how to solve it. Shouldn't my code create the
EZobject and dispose of it each time?
Thanks for any help youcan provide
marcello
id a;
// here I create a "group" as a List. this does not create memory
problem.
a=[EZDistribution createBegin: [self getZone]];
[a setTitle: "stats"];
[a setGraphics:0];
[a setBinCount: 5];
[a setLowerBound: 0];
[a setUpperBound: 5];
[a setCollection: group ];
[a setProbedSelector: M(getTypology) ];
[a createEnd];
[a update];
[a drop ]; //shouldn't this line dispose of "a"?
[group drop];
thanks alot
mc
--
Marcello Gallucci (Ph.D)
Department of Social Psychology
Free University
Van der Boechorststraat 1
1081 BT Amsterdam (NL)
Tel. +31(0)20 4448846
Fax +31 (0)20 4448921
- [Swarm-Support] memory problems,
Marcello <=