MantisBT - VCMI
View Issue Details
0002349VCMIGUI - PreGamepublic2015-12-15 09:282024-01-15 22:21
SXX 
SXX 
normalminoralways
resolvedfixed 
0.98e 
 
0002349: Huge memory leak on opening / closing load save menu
Problem appear both in PreGame and in game.

Looks like and according to Valgrind's Massif most of memory loss because std::vector of CTypeList information don't get deleted. In the end it's all linking to SelectionTab::parseGames, but leak is likely deeper.
No tags attached.
? massif.out.16383 (190,371) 2015-12-15 09:31
https://bugs.vcmi.eu/file_download.php?file_id=2401&type=bug
? massif.out.26569 (242,386) 2015-12-15 09:31
https://bugs.vcmi.eu/file_download.php?file_id=2402&type=bug
Issue History
2015-12-15 09:28SXXNew Issue
2015-12-15 09:31SXXFile Added: massif.out.16383
2015-12-15 09:31SXXFile Added: massif.out.26569
2016-08-28 04:08SXXAssigned To => SXX
2016-08-28 04:08SXXStatusnew => assigned
2016-08-31 02:08SXXNote Added: 0006598
2016-10-02 13:36vmarkovtsevNote Added: 0006803
2016-10-02 13:44SXXNote Added: 0006804
2016-10-02 13:51SXXNote Added: 0006805
2016-10-02 13:54SXXNote Edited: 0006804bug_revision_view_page.php?bugnote_id=6804#r3260
2016-10-02 14:08SXXNote Added: 0006806
2024-01-15 22:21IvanStatusassigned => resolved
2024-01-15 22:21IvanResolutionopen => fixed

Notes
(0006598)
SXX   
2016-08-31 02:08   
Just in case this one still there.
(0006803)
vmarkovtsev   
2016-10-02 13:36   
I cannot reproduce this...

    MB
107.7^ :::::::
     | @:::::@::@:::::::::@:::::@::::::::#: ::::::::::@::::::@:::::@:::
     | @:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | ::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | ::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | ::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | ::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
     | @::@:@@:::: @: @:::::: ::@:::::@::::::::#: :::::: :::@::::::@:::::@:::
   0 +----------------------------------------------------------------------->Gi
     0 14.52

I open load menu, close it and still get 100 MB memory consumption. I clearly see that in your case it goes up to 300 in the end.

    MB
289.8^ #
     | #
     | #
     | #
     | #
     | #
     | #
     | @@@#
     | @ #
     | @ #
     | @@ :::: ::: :::: ::: :: ::::@ #
     | @ ::::::::::::::: : ::::::::::::: : :::::@::::::::::: :::@@:::: : @ #
     | @ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | @ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
     | :@ : ::: :::: ::: : :: ::: :::: : : :::: @:: :::: : : :: @ :::: : @ #
   0 +----------------------------------------------------------------------->Ti
     0 1.730

Something special in the file list? Can you archive your save games directory and attach it?
(0006804)
SXX   
2016-10-02 13:44   
(edited on: 2016-10-02 13:54)
It's wouldn't be easy, but I'll upload it.
I have 5GB of save files (more than 500 saves) :-)

(0006805)
SXX   
2016-10-02 13:51   
BTW after we fixed multiple leaks and you fixed bonuses problem become less noticeble, but it's still there. In past it leaked like 20MB even with few hundreds of saves.
(0006806)
SXX   
2016-10-02 14:08   
Ok here you go:
http://fileshare.arseniyshestakov.com/SXXSaves.7z [^]