[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: Memory growth.



Hi Sebastian,

I'm very much interested in the work you have done on rdesktop.

When using rdesktop with my patch for 16 bit displays, I notice that
the memory is constantly growing.
I've tried memprof, glibcs mtrace, electric fence etc to try to find
where the memory is allocated, but since it is freeded at exit time, it
isn't so easy to find. It seem to be allocated inside Xlib, but I can't
see where.
Anyone have any better method of finding where the memory is allocated?

/Sebastian


I'm not an X11 expert but I took a look at the problem and my guess is that you have to call XDestroyImage(image) instead of doing XFree(image) and free(data).  I changed it in a couple places and I think I was able to reduce the leak significantly.  It's tricky to do throughout the code since the image data and the XImage itself are created in different places.

Then I changed the code so it detects the colour depth at runtime, works at least on xfree86 in 8, 16, 24 and 32 bpp.

Regards,
Sveinn.

-- 
Sveinn Sveinsson                      | mailto:svenni@strengur.is
Strengur ltd Computer Consultants     | mailto:ssveinss@informix.com
Ármúla 7                              | Phone: +354-550-9000
IS-108 Reykjavik                      | Fax: +354-550-9010
Iceland