c# - handle leaks with .net 4.0 system -


i using windows 2003 r2 , windows 2008 r2 .net framework 4.0 (64bit).

i have oltp windows service listens messages on socket , create threads processing each message. application expected process 200 transactions per second load varies time time(average of around 80 tps per day). problem facing reason, application creating handles , not getting rid of them. have used processexplorer tool see handles increasing event handles , other types of handles being released regularly. when happens, after day or 2 of execution handle count increases , application getting crashed outofmemory exception.

i have verified using processexplorer event handles not getting released have @ least 1 reference. problem have no control on them program not create handles explicitly. natural doubt on clr , upon investigation found https://connect.microsoft.com/visualstudio/feedback/details/430646/thread-handle-leak#tabs quote:” posted microsoft on 4/8/2009 @ 12:39 pm

thank feedback. threading developer on common language runtime (clr) team. problem report known issue in clr, , working fix in future release. problem clr thread handles (and other associated data structures) cleaned finalizer thread, runs in response garbage collection (gc). if many threads created , destroyed before gc occurs (which case if there few memory allocations in meantime) has effect of "leaking" handles , memory, althgough these reclaimed next time finalization triggered. workaround periodically manually trigger finalization, through calls gc.waitforpendingfinalizers. said, working correct in future clr release.

posted ed nicholas on 4/7/2009 @ 8:20 am” on same page, microsoft has marked issue fixed, see no reference version of clr contains fix.

i have reviewed following threads/links.

handle leaks .net system.threading.thread class

https://connect.microsoft.com/visualstudio/feedback/details/430646/thread-handle-leak#

can suggests workable solution? in advance.

wajid hussain

i have got similar issue, , turned out has antivirus software installed. try software in safe mode and/or antivirus disabled. if helps, can solve issue way jim mischel suggests: elaborate messages using queues , persistent threads. (to complain @ antivirus software provider solution) recommend read comments .net memory leak when creating lots of threads


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -