Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)
Home

[Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Wonder obsolesence across games (PR#1434)
From: Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 May 2002 09:02:47 -0500

On Mon, May 13, 2002 at 10:59:23AM +0200, Raimar Falke wrote:
> > 
> > we already have a [smaller] memory leak when diconnecting and
> > reconnecting to the server (or quitting the server and restarting it).
> > this "fix" really intensifies the memory leak---depending on the
> > savegame size---by about an order of magnitude.
> > 
> > We should probably introduce a game_free() function that frees all the
> > lists and players and such before calling game_init()
> 
> About what memory leak are we talking here?

I didn't look too hard, but the symptom is easy enough to see: without your
patch connect and disconnect to a running game and watch civclient's memory
usage go up, both in gtk and xaw (though xaw doesn't go up as much)
Actually what I did was quit and restart the server, etc...

apply your patch and watch the memory usage go up more than 10 times 
what it did unpatched, esp. if it's a large game.
> 
> If you look at idex_init and map_allocate: both free the stuff before
> they allocate new memory.

the map frees, yes, but I don't believe the player maps are freed if I 
recall, and I don't believe that most of the linked lists get freed, at 
least not explicitly. (what seems to change with the game_init() is the
gen-impr vectors...)

-mike


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