in reply to Threads memory consumption
1. Reuse existing threads over and over, passing in new data to them.
2. Better yet, especially if you are on Linux, use forks instead of threads. The forks will release memory when they exit. The only useful reason for incurring the overhead associated with threads is if you need to share data between threads in real-time. Even then, forks with SysV IPC shared memory works better and faster. Threads is just a lazy easy way of getting IPC, but it comes at a cost, as you have seen.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threads memory consumption
by mojo2405 (Acolyte) on Dec 05, 2013 at 15:07 UTC | |
by zwon (Abbot) on Dec 05, 2013 at 15:36 UTC | |
by mojo2405 (Acolyte) on Dec 06, 2013 at 12:16 UTC | |
by zentara (Cardinal) on Dec 06, 2013 at 17:55 UTC | |
by zwon (Abbot) on Dec 06, 2013 at 15:07 UTC | |
by mojo2405 (Acolyte) on Dec 08, 2013 at 09:18 UTC | |
| |
by mojo2405 (Acolyte) on Dec 19, 2013 at 19:09 UTC |