Page 1 of 1

BA keeps all pictures on memory and crashes

PostPosted: 17 Nov 2012, 17:26
by Jean le Chauve
Rheikon reported on Slightlymagic:
If you look at lots of pictures BA keeps them all in memory eventually crashing when running out. On occasion it will simply stop showing pictures.

I've tested it and that is right and happens on deckbuilder when you see between 2500 and 3000 cards, ay least on my PC. I never got it playing games.

BA must be picture memory cache limited to for example 500 card or so.

marek14:
That would probably explain some of my crashes, given that I'm prone to play with big testing decks containing lots of cards.

void:
As a matter of fact such a mechanism is already implemented.
CGdiplus::FlushBitmaps() is called (no more often then 10s between calls) then there are more then 256 pictures stored.
At least that's what I can see in the code.

The mechanism is so advanced that it takes into account hit ratio.

FranAvalon:
To me BA crashes when it hits a size of 1.3 Gb more or less.

If i load all card images from letter A, it get a size of 614 Mb, and after wait a couple of minutes, it down to 469 Mb, and no more changes happen on next 5 min.

MORE TEST:
If you exit from deckbuilder, size doesn't down, but if you start a game, and then you finnish it, BA size goes to 98Mb more or less. So end game has a rutine to clear card picture cache.

void:
Jul 17, 2011, 5:24pm, FranAvalon wrote:

If you exit from deckbuilder, size doesn't down, but if you start a game, and then you finnish it, BA size goes to 98Mb more or less. So end game has a rutine to clear card picture cache.
The routine is CGdiplus::ClearBitmapCache

The logic and functionality is there, but some bug has slipped into it.