It sounds as if not the number of threads is the problem,
but the amount of memory that is used by the threads.
May be you should track the memory usage to verify that
the memory is low when this Exception happens)
(Just log the results of Runtime.[free|total]Memory())
-Original
OutOfMemoryError is a bad error description in java. It can mean any of
the following:
- Actually ran out of memory
- Hit max # of threads allowed to run
- Ran out of file handles - File handles include open files AND sockets
- (?) Your JVM is bigger than the max process size allowed
- Other