0

I have machine with ws2008 x64 and .net 3.5 installed. I have a few .net applications that are run as scheduled tasks. When they exit is seems that not all memory is released. So after a few hours I get error messages with information that I do not have available memory. I tried to run really simple .net console application as scheduled task (this application only show message on console) and I got the same results.

Did you have ever similar problem ? What did you do ?

Jeff Yates
  • 60,114
  • 20
  • 136
  • 187
Darqer
  • 2,770
  • 7
  • 43
  • 60
  • 1
    That's a new one on me. I've never had a .NET application leak memory after shutting down. What is this application doing? Is it using file handles, network connections, or other system resources that it's not cleaning up? (Although the OS *should* be releasing those when the application shuts down.) – Jim Mischel Feb 08 '11 at 00:04
  • Did you use Application.Exit in your Console Applications? – Crimsonland Feb 08 '11 at 00:05
  • 1
    Do the applications 'really' exit? Check via taskmgr.exe / process explorer whether you have orphan & still-running instances of your app running. If you do, well all you can do is debug (if possible attach to one of the running ones). And for 'really simple' - .Net Console applications do exit just like any other process and do not leak memory / stay running by themselves, so something has to go on. If possible, share the code here as this might allow give a proper answer instead of generic hints as a comment. – Jörg Battermann Feb 08 '11 at 00:08
  • @Jim It happens only on this machine so I think that there is an issue with .net and I wonder if one have such a trouble and what might be possible solution. Application uses web services, however simple application I tested it with just show message. @Jorg Application really exit I cannot see it in task manager. @Crimsonland I do not use Application.Exit ... should I ? – Darqer Feb 08 '11 at 00:15
  • What were you saying about a simple application that you tested with just show message? Are you saying *that* leaks, too? – Cody Gray Feb 08 '11 at 07:27
  • On this particular machine it leaks, on other it is ok. – Darqer Feb 08 '11 at 15:58
  • @Jim I've never heard of **any** process leaking memory after it has ended! – Justin Feb 18 '11 at 16:00
  • Can you describe how you are detecting this memory leak? – Donald Byrd Feb 18 '11 at 16:08
  • Are you using any classes that have unmanaged data in them? You might need to `Dispose` of them or wrap them in `using(){...}` to ensure they dispose of the unmanaged members correctly. – Kernow Steve Feb 18 '11 at 16:11

0 Answers0