Memory Leak

From AlliedModders Wiki
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.

See also: Memory leak (Wikipedia)