brucew...@canada.com wrote:
> Are you using the Image class? I've found that you have to call Dispose
> on Images when you're done with them or they just sit around taking up
> memory.
No, I am not. My solution include Server and Windows client Side. The
Leak is on the server (2 added threads - 1 get data from Sensors
Source(by Simulation from FileStreem and save each data block to
Queue.Enqueue(Data),the 2 get it from Queue.Dequeue and process). By
Simulation the file is reading from begin to end,from begin to end,...
by 5 seconds Frequency and data is updated to MS SQl DB table. After 2
hours work Mem Usage of sqlservr.exe and
my server grows Catastrophic (before this it is stable) , I get Windows
Message
"You system is running low on virtual memory..." and so on.
Sonia.
Richard Grimes [MVP] - 20 Dec 2004 21:11 GMT
> No, I am not. My solution include Server and Windows client Side. The
> Leak is on the server (2 added threads - 1 get data from Sensors
[quoted text clipped - 6 lines]
> Windows Message
> "You system is running low on virtual memory..." and so on.
Bruce probably has the solution. If you are using objects that have
resources then you should only keep hold of those resources for as long as
you need them. In general, if the object has a Dispose method (implements
IDisposable) then you should call this method when you know you no longer
need the object (typically I usually assign the reference to null/Nothing
too at this point). If you don't do that the resource will be held until
finalization occurs, and this could be after many hours. In general objects
that implement Dispose also implement Finalize and this last method will
actually make the object live longer!
So check your code for objects that have a Dispose method and call this
method as soon as you can, also, make sure that you create such an object as
late as possible: create late, release early.
Richard

Signature
.NET training, development, consulting and mentoring
www.richardgrimes.com
my email evpuneqt@zicf.bet is encrypted with ROT13 (www.rot13.org)