RE: Memory Leak in C# Windows Service
- From: "Brian Hman" <bhbhbh@xxxxxxxxxxxxxxxx>
- Date: Fri, 19 Aug 2005 13:15:04 -0700
Vladimir,
With your database connections and datareaders you want to make sure
that they are being "closed" when you're done with them. So if you create
a rdr with the application block you need to make sure that you call
rdr.close().
Also if you happen to use any COM objects in your code you need to use
System.Runtime.InteropServices.Marshal.ReleaseComObject
to release the COM object rather than just setting it to null.
HTH
Brian Hman
"Vladimir" wrote:
> I created a windows service that performs a MSSQL2000 database analysis in a
> separate threads with a specified interval. And when running this service
> uses a lot of system memeory and it does release it after finishing it's
> jobs and starting to "sleep". I use there Microsoft.AplicationBlocks.Data
> libary to access database and I suppose the service caches the data since it
> performs all the next parcings at a moment unlike at the first time for 20
> minutes. Actually the service is working fine except memory leak, I have put
> null to every object, and made sure that Microsoft.AplicationBlocks.Data
> libary closes db connections.
>
> Does anybody know how can I make my service to release memory when it is
> finished it's job and how can I manage the ADO.NET caching?
>
> Thanks
>
> --
>
>
> - Vlad
>
>
>
.
- References:
- Memory Leak in C# Windows Service
- From: Vladimir
- Memory Leak in C# Windows Service
- Prev by Date: Re: tab web control
- Next by Date: Adding custom DataGridView column styles to studio designer
- Previous by thread: Memory Leak in C# Windows Service
- Next by thread: Software Development
- Index(es):
Relevant Pages
|