.NET Windows Service, threads and garbage collection (possible memory leaks)

Posted by Evgeny on Stack Overflow See other posts from Stack Overflow or by Evgeny
Published on 2010-04-09T06:21:29Z Indexed on 2010/04/09 6:33 UTC
Read the original article Hit count: 269

I am developing a .NET Windows service that is creating a couple of threads and then uses these threads to send print jobs to printers (there is a thread for each printer). I have some issues which sometimes can be fixed by restarting the service. Some issues also arise when the service has been running for a while. This makes me suspect a possible memory leak. So, a couple of questions:

Would a garbage collector collect an object if it was created inside a thread, or will the object exist until the thread is stopped/terminated?

What tools can I use to monitor the amount of memory used by a Windows service and by a thread that I am starting programmatically?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about service