Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2000:
[Freeciv-Dev] Re: Memory leak (PR#605)
Home

[Freeciv-Dev] Re: Memory leak (PR#605)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Memory leak (PR#605)
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Sat, 18 Nov 2000 01:03:51 +0000 (WET)

On Fri, 17 Nov 2000, Andreas Kemnade wrote:

> Thue writes:
>  > 
>  > On Fri, 17 Nov 2000 12:36:09 guenther.berger@xxxxxxxxxxxxxxxxx wrote:
>  > > 
>  > > I've discovered that the memory that is allocated per second (4-8 KB)
>  > > comes from
>  > > the blinking of the active unit. When no unit blinks, the memory usage
>  > > doesn't increase.
>  > > As far as I know is that the Win32 Clients are built from the same code
>  > > base and
>  > > the bug only occurs in the Win32 Client. I've only tested the version
>  > > that doesn't require an X-server, but uses GTK-Win32-port.
>  > > I believe that the memory leak is inside the GTK-libs and not in the
>  > > Freeciv-client.
>  > 
>  > That would then mean the link is in the tile redraw code.
>  > 
> The leak seems to be in pixmap_put_tile but the bug seems to be in gdk
> code. 
> In the windows binary archive (without X) there is a diff named
> freeciv-1.11.4-win.diff.gz (50kB unpacked). Windows binaries without X
> and with X are not built from the same source code. As long as the
> networking abstraction layer is not in cvs, porting the gtk gui code
> changes to cvs is nonsense. 
> 
> The struct Sprite is different. The source sprites are also stored and
> the cropped pixmaps are created by crop_sprite_real. They are only
> allocated if they are really needed because windows cannot maintain
> many bitmaps. pixmap_put_tile uses the source
> sprites.
> That code works on linux without a memory leak. So I think the bug
> is in gdk, too. 
> 
> I have a native windows client (without gtk).
> It already has:
>    a working map window with units blinking (no memory leak)
>    a connect dialog.
>    a working menu.
>    a message window (append_output_window works)
> 
> The other dialogs are missing.
> It is much faster than the gtk client (esp. scrolling the map).
> It works fine with wine (tested with Wine release 20000109 on linux)
> and win95. I have not tested it on other windows versions.
> 
> When it is a bit more complete I will release test versions and a port
> to cvs.

It would probably be a good idea to add support for big pixmaps in
gdk-win32 itself instead of kludging around in the client.  This way other
gtk+-win32 programs would benefit.  Every gtk+ bug should be fixed in the
library if possible and sent to the gtk+-win32 maintainer IMHO.  Unless
the kludge is small and much less painful than patching the lib.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa




[Prev in Thread] Current Thread [Next in Thread]