I'm quite new to threading in Python and have a couple of beginner questions.
When starting more than say fifty threads using the Python threading
module I start getting MemoryError
. The threads themselves are very slim and not very memory hungry, so it seems like it is the overhead of the threading that causes the memory issues.
- Is there something I can do to increase the memory capacity or otherwise make Python allow for a larger number of threads?
- What is the maximum number of threads you've been able to run in your Python code using the
threading
module? Did you do any tricks to achieve that number? - Are there any other caveats to be aware of when using the
threading
module?