From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ariel Rios To: guile-gtk@sourceware.cygnus.com, federico@helixcode.com Cc: guile@gnu.org Subject: Big memory problem with the canvas and gnome-guile Date: Mon, 11 Dec 2000 11:50:00 -0000 Message-id: X-SW-Source: 2000-q4/msg00067.html Recently for a school project I wrote a simple L-System generator that comes with a logo-like implementation that enables to do a graphical interpretation of the strings generated by the L-System Look on: http://www.cogs.susx.ac.uk/users/gabro/lsys/lsys.html for more info on L-Systems We need to take an L-System like: w: F+F+F+F p: F -> F+F-F-FF+F+F-F and then according to the number of substitutions we do we get a final string. Each F is interpreted as draw a line and the + - signs indicate a change on the angle. for drawing each line I do: (gnome-canvas-item-new (root-component obj) 'GnomeCanvasLine :points (vector xo yo xf yf)) The problem is that when I do select an iteration number >= 5, the pogram is damn slow and starts using memory in a huge way. My thought is that creating a big number of canvas items is taking that bunch of memory. HOwever I don't know if its a guile, guile-gtk or GNOME canvas memory problem. Can you help to track me down this problem? Obviously I can change the hack and instead of drawing a line per each F found on the string I can create a global vector to create at the end only one canvas item. Still I would like to track the memory problem. You can find the code at: http://www.netpedia.net/hosting/erin/download/lsys.tar.gz It includes the code and a small document about L=Sys. To run it you need to do: guile-gtk -l lsys-main.scm You need to have a working gnome-guile, guile 1.4 and goops 0.9.0. Thanks! ariel