VB.Net and erractic memory handling??

fdekeyser

Newcomer
Joined
Oct 17, 2003
Messages
2
memory leak

Hi there,

Finally I found someone that confirms that there might be a problem with the garbage collector.
I wrote windows services, that seems eat al the memory there is. Once alle memory is occupied, they keep working, the computer does nog crash, and garbage collection only start when some extra program is started that needs memory. After Stopping that extra program, an amount of memory seems to be released. I Assume that the GC has done that.
Since I have a service, I cannot minimize and remaximize as can be done with some windows forms application.

I have been studying "Dispose" and "Finilize" methods, but not all .Net framework classes seem to support that.
I also notice the more instances you create ( i = new object ) and release ( i = nothing ) withing the service, the faster the memory grabbing goes.

I centainly looking forward to hear from anybody in the field, that gets closer to some indication of what this mistery might be ...
 
I'm glad I stumbled across this topic. Yes, I agree, the windows service applications do not seem to control memory usage very good with the garbage collector. I'm creating a service application that polls two ODBC datasources and updates another ODBC datasource on a 3 second interval. In short, my service uses System.Data.Odbc classes all over the place. I call dispose wherever possible and always dereference objects and variables but I have a slow leak that is present. I broke down the code to basic fundamental connect and disconnect every 3 seconds (using an MS Access db no less-yeah I know it does not allow connection pooling) to a database using the ODBC data provider. All this thing did was connect, open, close and then dispose and destroy all objects/variables. The result: memory usage went from 11,100 K to 11,585. I can't pinpoint where it comes from. If you have any suggestions on some memory techniques please let me know.
Thanks,
Richie
 
Back
Top