Reputation: 959
I am using tracelistener in a multithreaded application to log message remotely, but the appllication creates memory overflow.
For testing I created 10,000 threads, and tried to log messages using TraceData function.
Does .Net framework create an object for every call to TraceData, which result in memory overflow?
Upvotes: 0
Views: 216
Reputation: 108975
10,000 threads: each will have a (default) 1MB stack space allocated. Therefore they will need 10GB RAM, which is impossible on a 32bit process (and likely to break total available RAM/Page on 64bit).
Nothing to do with tracing.
Additional: Great new article on thread (and process) limits on Windows, by Mark Russinovich. Please note the final paragraph. "Pushing the Limits of Windows: Processes and Threads"
Upvotes: 4