Memory leak cause found: user allocated data in frame was not freed by Mat class destructor. Destroying it by myself solves the problem on sequential version. On threaded version, one leak still remains: module 1 reads frames faster than modules 2 and 3 can process them. This causes the program to quickly full the main memory. Possible solution: merge modules 1 and 2. Another one: cause a delay on module 1.