• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Leak Check

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Excessive leaks can result in degraded map performance and potentially even out of memory errors (with a crash) when the user's page file is exhaused or the virtual memory address space for the process is exhausted.

However generally leaking too much will cause frames to be dropped and crash WarCraft III due to internal resource exhaustion long before memory becomes a problem on a modern system.

Be aware that not all leaks can be fixed. WarCraft III is a very buggy game and has its own memory leaks.

Leaks that cannot be prevented.
String: Every unique string you generate in JASS (which GUI compiles to) will stay in memory until the map session ends. After enough unqiue strings are leaked it will become performance intensive to perform any string operation.
Unit: Every time a unit is created a bit of memory is leaked. No mater how the unit meets its end it will still result in a permanent memory leak. Whether it dies of natural causes, killed by triggers or even removed by triggers the same leak exists.

Leaks that can be prevented.
location: After creating a location you can call the appropiate destructor on it (RemoveLocation).
group: After creating a group you can call the appropiate destructor on it (DestroyGroup).
effect: After creating an effect you can call the appropiate destructor on it (DestroyEffect).
force: After creating a force you can call the appropiate destructor on it (DestroyForce).

There are other destructors as well but those are the most common.
 
Status
Not open for further replies.
Top