This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Big memory problem with the canvas and gnome-guile
- To: guile-gtk at sourceware dot cygnus dot com, federico at helixcode dot com
- Subject: Big memory problem with the canvas and gnome-guile
- From: Ariel Rios <ariel at arcavia dot com>
- Date: Mon, 11 Dec 2000 13:24:02 -0500 (EST)
- cc: guile at gnu dot org
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