glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Re: Memory Consumption ~Alpha 21 release


From: Kieran P
Subject: Re: [glob2-devel] Re: Memory Consumption ~Alpha 21 release
Date: Sat, 14 Jul 2007 11:26:14 +1200

Awesome Brad. I personally haven't noticed that much of a change (I've got Core Duo AMD Athlon X2, anmd 2gigs of ram, so it only affected it slightly), but I'm sure people with non powerful computers (like my Windows computer I've not tested on yet) will greatly appreciate this!

Regards
Kieran


On 7/14/07, Bradley Arsenault <address@hidden> wrote:
On 7/13/07, Bradley Arsenault <address@hidden > wrote:
After looking at a profile, and it suddenly occurred to me what the problem may be for the excessive memory consumption, and yes, it would be my fault.

Do you know the overlay areas? In the graph screen when playing the game, you can select to draw overlay areas, which can show you where your defense is best, or the highest concentrations of starving or damaged units, usefull to know where to place hospitals or inns.

Well, I made the mistake of storing one for every statistic frame, and there are 128 of them. As soon as the game initiates, it fills 3 * 128 vectors with width*height integers, and thats huge memory. Provided sizeof(int) is 3 (24 bits), the total usage (per team) is 18 mb on a 128x128 map, and 288 mb on a 512x512 map, which explains the problem. I feel rather near sited not to have seen this when I made the feature last year.


I'm making the correction in the master, to only compute for the current frame, only for the local team, only for one vector at a time, and using Uint16 to limit the size of the integer, since this is all thats required. No memory is waisted.

I have commit the fix to the master branch (and merged into the gamegui_rewrite_2007 branch). The game runs noticably faster now, and with less memory.

reply via email to

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