bugBos Wars - Bugs: bug #29284, Custom patches leak

 
 

bug #29284: Custom patches leak

Submitted by:  François Beerten <feb>
Submitted on:  Sun 21 Mar 2010 04:01:10 PM UTC  
 
Severity: 2 - MinorItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Jimmy Salmon <jsalmon3>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 23 Apr 2010 10:53:26 PM UTC, comment #5:

Fixed in r9784

Jimmy Salmon <jsalmon3>In charge of this item.
Fri 23 Apr 2010 03:23:26 AM UTC, comment #4:

CPatchManager::clear() calls clearPatches(this->patches) which frees the graphic. The tile flags remain in memory but you're only looking at 32k for a 128x128 map. Is this really a big concern?

Jimmy Salmon <jsalmon3>In charge of this item.
Sun 11 Apr 2010 09:42:09 AM UTC, comment #3:

oops, sorry, that test case does not belong to this bug at all.

Kalle Olavi Niemitalo <kon>
Project Member
Sun 11 Apr 2010 09:41:39 AM UTC, comment #2:

Test case:

  1. Start the map editor.
  2. Create a 32x32 map.
  3. Add patch te5 (16x16) at the northwest corner.
  4. Add a medic at (1, 1).
  5. Add a hot spot at (3, 1).
  6. Add a magma pump at (3, 1).
  7. Delete the medic.
  8. Save the map.

The generated setup.sms then ends with:

  1. Exit the editor.
  2. Restart the editor.
  3. Load the map just saved.
  4. The hot spot has moved to (1, 0); the magma pump is still at (3, 1).
  5. Save again.

The generated setup.sms then ends with:

Kalle Olavi Niemitalo <kon>
Project Member
Fri 26 Mar 2010 06:59:46 AM UTC, comment #1:

StartMap calls CleanGame, which calls CMap::Clean, which calls CPatchManager::clear. If loadedAll is true, then that calls CPatchType::clean, which calls CGraphic::Free. So just removing the loadedAll check should reduce memory consumption quite a bit. The CPatchType::flags arrays would still consume some memory but they cost only 2 bytes per map tile, while the graphics cost at least 32*32=1024 bytes per map tile.

Kalle Olavi Niemitalo <kon>
Project Member
Sun 21 Mar 2010 04:01:10 PM UTC, original submission:

In the development version of Bos Wars (2.6), the patches are not deleted when leaving a game. A map with a potentially large patch like in image based maps will continue eating lots of memory even when switching to another map.

One easy way to check for the error:
- Load an image based map with a custom patch
- Load another map which uses that custom patch but without containing a definition of the patch.
- The map will display correcly while it shouldn't as the patch hasnt been defined in the 2nd map.

This bug is particularly bad for image based maps.

François Beerten <feb>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kon (Posted a comment)
  • -unavailable- added by feb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 Apr 2010 10:53:26 PM UTCjsalmon3StatusConfirmed=>Fixed
      Assigned toNone=>jsalmon3
      Open/ClosedOpen=>Closed
    Fri 23 Apr 2010 03:23:26 AM UTCjsalmon3Severity3 - Normal=>2 - Minor
    Sat 27 Mar 2010 11:22:46 AM UTCfebStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1