File stream dispose not releasing memory causing further downloads slow

  • Thread starter Thread starter HariharaKrishnan
  • Start date Start date
H

HariharaKrishnan

Guest
Hi all,

I am writing a WCF application which response is streamed Net TCP binding. There are GBs of files to download one by one by the client, so it runs on a loop and I use FileStream class. I use using statement block and closing the opend file streams properly.

I am using a mechanism to download parallel using max request connections. Maximum of 8 requests hit the WCF endpoint.

When I am checking the Taskmanager, it shows that the memory utilization by the application keeps on growing for each file download. After downloading 1500 plus files the memory utilization peaks to 120 MB. After this network utilization decreases and the remaining files are downloading in a slow bandwidth. It starts from 70 to 90 Mbps and gradually decreases to 1Mbps speed.

When I restart the application the memory are freed up and the same story runs again.

I even tried GC.Collect() but no improvements. I am not sure what is happening in the life of my application.

Can anyone explain me how can I resolve this. That would be really helpful.

Continue reading...
 
Back
Top