I have a .NET application where I instantiate a WCF proxy which is held in memory till the application shuts down. Think of a singleton serviceagent that references the proxy, i.e. the proxy is reused for consecutive service calls. There are no explicit calls to proxy.Dispose() or using blocks.
The question is, am I leaking any resources? As far as I can tell, .NET garbage collection will prevent this from leaking memory (proxies are managed are they not?). Anything else – Network connections, ports etc?
edit: the item is not being held in another process outside of the application.
No. Once your application terminates, unless you’ve allocated global resources like shared memory/etc, Windows will close all your sockets and release all memory that was allocated to your program. If you think there’s something akin to a leak, it may be because your program is not fully terminating (check Task Manager).