Avoid Memory Leaks

(67 occurrences)

Memory related issues which affects the performance of games are categorized in this theme.

Context

Games involve different game objects, and assets which consumes a lot of memory. This memory storage should be used wisely, otherwise it can cause memory related issues.

Problem

Memory leak causes reduction in available memory for usage, which causes bad performance.

Solution

To avoid memory leak problem, developers should free up the unnecessary variables and game objects, and should use the idea of data locality [1]. Developers should use object pool where memory can be reused instead of allocating and freeing them everytime [1].

Example

Consider an arcade game, where different game objects keeps on appearing and disappearing in the game play. These objects needs to be handled carefully in the memory to avoid memory leak.

Reference

[1] Nystrom. Game programming patterns. Genever Benning, 2014.

Occurrences

Commits
39 occurrences