Reusing WCF Proxy to reduce Memory Usage

Posted by Sudheer Kumar on Geeks with Blogs See other posts from Geeks with Blogs or by Sudheer Kumar
Published on Tue, 20 Apr 2010 13:38:00 GMT Indexed on 2010/04/20 13:43 UTC
Read the original article Hit count: 421

Filed under:

I am working on a program that uploads BLOB from DB to a Document Management System.

I have a WCF service to interact with the DMS.

I have a multi-threaded client program that uploads the BLOBs to DMS and every thread used to create and dispose a proxy instance for every record to update.

When I have a large no of records to convert, I found that the tool’s memory foot print keeps increasing. After a little debugging I found that the WCF proxies are the culprits for excessive memory usage.

I changed the program to re-use the proxies to the service, having one proxy per thread.

So in some scenarios, it might be beneficial to re-use WCF proxies.

© Geeks with Blogs or respective owner