| Author |
Message |
flcdrg
Joined: 16 Feb 2009 Posts: 12
|
Posted: Mon Feb 16, 2009 2:30 am Post subject: Lots of .tmp files left behind |
|
|
We're using the SDK components on our build server, but I've noticed that they seem to be leaving behind lots of undeleted tmp files.
Specifically, the folder
C:\Documents and Settings\<buildaccount>\Local Settings\Temp\Red Gate
currently has over 15,000 .tmp files in it, which seem to correspond roughly to when we've run our database unit tests (which use the red-gate SDK to rebuild the database for each test).
Each file appears to be a binary file, and has a guid-like filename, with the .tmp suffix.
Is there something we need to do to clean up these files, or is this just a bug that Red Gate need to fix?
-dave |
|
| Back to top |
|
 |
Michelle Taylor
Joined: 30 Oct 2006 Posts: 519 Location: Red Gate Software
|
Posted: Mon Feb 16, 2009 12:10 pm Post subject: |
|
|
Are you disposing all Database objects etc etc when you finish with them? It's possible for your SDK application to leave a lot of temporary files lying around if you don't obsessively dispose everything when you're done with it . |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Feb 16, 2009 12:10 pm Post subject: |
|
|
Thanks for your question.
Typically these temporary files are cleaned up as part of the Dispose() method of the objects you're using. Generally, any object that implements Dispose() should have Dispose() called on it, for instance the Database object will leave an entire snapshot of a database schema behind in the temporary files folders unless it's disposed when you're done with it.
I think that any temporary files are cleaned up if you put the object (eg Database) in a using block as well, if you only need the object briefly.
There may be some problems cleaning up, however, if there are any crashes happening in your program. .NET 2.0 employs a "critical finalizer" to clean up objects that implement IDisposable which may or may not do the job. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
flcdrg
Joined: 16 Feb 2009 Posts: 12
|
Posted: Tue Mar 10, 2009 4:13 am Post subject: Re: |
|
|
| Michelle Taylor wrote: |
Are you disposing all Database objects etc etc when you finish with them? It's possible for your SDK application to leave a lot of temporary files lying around if you don't obsessively dispose everything when you're done with it . |
We've checked our code and we're pretty confident that we are using 'using' every time (checked with FxCop to be sure).
-dave |
|
| Back to top |
|
 |
simon.jackson
Joined: 08 Jan 2009 Posts: 45
|
Posted: Fri Mar 13, 2009 2:38 pm Post subject: |
|
|
| Are new temporary files left behind after every normal run, or are they only occasionally created? |
|
| Back to top |
|
 |
flcdrg
Joined: 16 Feb 2009 Posts: 12
|
Posted: Sun Mar 15, 2009 11:56 pm Post subject: Re: |
|
|
| simon.jackson wrote: |
| Are new temporary files left behind after every normal run, or are they only occasionally created? |
The times of the files seem to correspond pretty closely to our automated build times, so I'd say "every time".
-dave |
|
| Back to top |
|
 |
simon.jackson
Joined: 08 Jan 2009 Posts: 45
|
Posted: Tue Mar 17, 2009 12:52 pm Post subject: |
|
|
| Would it be possible to pm me the relevant sections of code? or email me with my login at redgate.com |
|
| Back to top |
|
 |
|