LeaST (Leak Strike Team) Headquarters
This is the area where we put all information relevant to memory leak fighting. To fight leaks, the Strike Team has two missions:
- Kill all leaks currently present in Elisa
- Prevent new leaks from happening
Later on, when everything's in place and all leaks are defeated, the LeaST will be transformed to the MOST (Memory Optimisation Strike Team), and will try to find ways to optimise the memory consumption of Elisa.
Leak Killing
This part is more specifically aimed to the Strike Team, and is detailed in QualityAssurance/LeaST/Kill
Leak Prevention
TODO: write guidelines (and possibly tools) for checks to be done for every merge requests. These checks should be easy, fast, and detect leaks efficiently.
- always disconnect from signals to which you connect (if you can logically do it earlier than clean(), do it)
- if you implement clean(), always call your parent's clean, and do this using super(). Do that *last*, and return the value returned by it.
- set your members to None, especially big ones
- do not forget to clean() your members that have a clean() method (ie anything that is a Node or a Component, that includes Widgets and Controllers)
- test your stuff with
- watch -n1 ps -C elisa -ocommand,pid,rss
- if node is in group, to remove it, you should use node.clean() and not
- group.remove(), unless you know that node is used elsewhere.
Interesting references
http://wingolog.org/archives/2007/11/27/reducing-the-footprint-of-python-applications
