swarm-support
[Top][All Lists]
Advanced

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

Bug report: use of Pixmaps


From: Sven N. Thommesen
Subject: Bug report: use of Pixmaps
Date: Sun, 04 Apr 1999 22:30:54 -0500

As I told some of you at SwarmFest, I have suddenly discovered that a
simulation that previously ran without problems suddenly started to eat
memory -- and the peculiar thing was that it wasn't the app itself that
grew, it was X-windows! My app now crashes when X exceeds the size of
physical memory + swap space.

I have spent some time tracking down the problem, which proved to be quite
obscure.

As it turns out, the problem in question only affects a small number of
Swarmers, because both the following had to be true: (a) I use Pixmaps to
display my agents on the raster(s) instead of just color dots; and (b) I
display each agent on two different rasters.

To get this to work, each agent has the following method, which is invoked
by the relevant Object2dDisplay object (one such object per raster for each
agent type):

-drawIconOn: (id <Raster>) r
{
   [bugPixmap setRaster: r];
   [r draw: bugPixmap X: x Y: y];
   return self;
}

The first line is needed, since the Pixmap needs to know which of two
possible rasters to display itself on. 

However, somewhere between 1.3.0 and 1.4.1, code has been added to
tkobjc/internal.m, to function 'tkobjc_pixmap_update_raster()', which is
called by -setRaster. The new code looks like it has someting to do with
allocating color maps -- but whatever the function it has, calling it
multiple times eats up memory.

I await suggestions from Marcus or anyone else ...

Sven Thommesen


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