memory usage in C# (.NET) app is very high, until I call System.GC.Collect()

Posted by Chris Gray on Stack Overflow See other posts from Stack Overflow or by Chris Gray
Published on 2010-04-25T01:27:18Z Indexed on 2010/04/25 1:33 UTC
Read the original article Hit count: 291

Filed under:
|
|

I've written an app that spins a few threads each of which read several MB of memory. Each thread then connects to the Internet and uploads the data. this occurs thousands of times and each upload takes some time

I'm seeing a situation where (verified with windbg/sos and !dumpheap) that the Byte[] are not getting collected automatically, causing 100/150MB of memory to be reported in task manager

if I call System.GC.Collect() i'm seeing a huge drop in memory, a drop of over 100MB

I dont like calling System.GC.Collect() and my PC has tons of free memory. however if anyone looks at TaskManager they're going to be concerned, thinking my app is leaking horribly.

tips?

© Stack Overflow or respective owner

Related posts about c#

Related posts about garbage-collection