• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Leak Check

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
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