What is some advice from the pros to avoid memory leaks? I know this can be a serious problem.
I think it might be of interest generally.
Memory leaks is a very serios problem in any software product, and games and their engines not an exception. Developer must always remember this
![Smiley :)](http://www.dead-code.org/forum/Smileys/default/smiley.gif)
The most heavy resources in our games (and wich you can control) - actors\their animation and sounds\speeches\music. We have big quantity of actor animations, thats why we have standart set of animations for every actor (walk\talk etc), and we are using MergeAnims on start scene to load unique animations for this scene. And UnloadAnims on change scene if its a global actor. If its a local actor (was loaded using Scene object), than you have no need to unload them, WME will do it for you.
In WMEngine theres some ways to control game memory, and it highly correlates with game optimization. For example, you can decide how to allocate some actors. Will it belongs to Game or Scene? If to Game, than you can load actor once for location, wich can consist of ten scenes (for example), reducing scene loading time. And if an actor allocating by Scene object, it means you will load actor for every scene, but actor will free his memory automatically on changing scene. In case of Game object you must to do it manual. So its some kind of balance between the need of manual control by allocation\deallocation and improvements in faster loading, more flexible memory consumption controling, and game performance.
But, big thanks to WME, you can move all responsibility to engine and dont think about memory at all. You'll only need to load every entity by Scene, and it will give you garanty of memory leak absence in your game.