numenta / nupic-legacy

Numenta Platform for Intelligent Computing is an implementation of Hierarchical Temporal Memory (HTM), a theory of intelligence based strictly on the neuroscience of the neocortex.
http://numenta.org/
GNU Affero General Public License v3.0
6.34k stars 1.56k forks source link

File descriptor leaking issue #3846

Closed emmaai closed 6 years ago

emmaai commented 6 years ago

When swarm.OFPModelRunner.run() finishes the loop and does self._finalize(), it doesn't release the file descriptor that it acquires at the beginning of loop, which caused file descriptor leaking issue. It will be reported as Not enough memory error on Linux if running with large enough set of data and many enough processes. The processes will be killed consequently.

It is fixed by adding if self._inputSource: self._inputSource.close() in self._finalize.

rhyolight commented 6 years ago

@emmaai good catch, thanks.