fdekeyser Posted October 17, 2003 Posted October 17, 2003 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 ... Quote
fdekeyser Posted October 17, 2003 Author Posted October 17, 2003 Handle your own memory leak Found some technical article with sample code on how to do it. I didn't try it out yet, but I wanted to post it to you before. http://www.devcity.net/net/article.aspx?alias=gc_manage Quote
rheap1 Posted October 18, 2003 Posted October 18, 2003 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 Quote
*Gurus* Derek Stone Posted October 18, 2003 *Gurus* Posted October 18, 2003 Your concerns are addressed in the following thread: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69454 Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.