Vladimir,
Set null to every object variable doesn't really solve the problem. You need
to run a profiler to find out what is real cause of the problem.
The way GC collector work is it checks for the root objects and its
refrences. Ad long as an object reference by a root object and its refrences
then the object will continue to live. So make sure that you do not have too
many unnesscessary root objects around.
Basically GC is designed to run automatically when it needed to. However,
you can force GC to run manually, but I only recommend this if your system
use com/dcom interop.
Hope this help,
Dinhduy Tran
[CSDP/MCSD]
[quoted text, click to view] "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
>
>
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