Memory Leak

From AlliedModders Wiki
Revision as of 11:12, 21 June 2012 by Dr. McKay (talk | contribs) (Created page with "A '''memory leak''' occurs when memory is allocated to a process, and is not freed. This results in memory being taken up by objects that are no longer in use. Eventually, the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A memory leak occurs when memory is allocated to a process, and is not freed. This results in memory being taken up by objects that are no longer in use. Eventually, the system will run out of memory and crash.

To prevent memory leaks in SourcePawn, one must always close Handles. Note that there are some types of Handles that cannot or shouldn't be closed. This will be noted in the documentation of the function used to open/get them.

SourceMod features a system to automatically reload plugins that it detects are leaking memory.