Re: [Mono-dev] Garbage Collection Issue?
Thanks for all the replies. I did try HeapBuddy and HeapShot but had some problems using both, although I was probably using the tip revisions. I'll give them another go. > "I gave my app a little time and memory was eventually freed but after a > longer period of time - maybe it's the same situation?" I don't think it's the same situation. I've been running some soak tests and eventually the process gets killed when the system runs short of memory (and there's quite a lot of memory available!). > This happened to me too, but I found the cause. It was a disposable object > that I replaced with another one without disposing of it first. I've tried setting some of the more obvious variables to null to try and help the Garbage Collector, but unfortunately it's made no difference. I'll double check for disposable objects though. Thanks again, Matt. > -Original Message- > From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list- > boun...@lists.ximian.com] On Behalf Of Stifu > Sent: 14 May 2010 9:21 AM > To: mono-devel-list@lists.ximian.com > Subject: Re: [Mono-dev] Garbage Collection Issue? > > > This happened to me too, but I found the cause. It was a disposable object > that I replaced with another one without disposing of it first. > > In my case, I found out doing the following gave the best results as far as > memory is concerned: > > myobj.Dispose(); > myobj = null; > myobj = newobj; > > Without setting the object to null, memory is fred later. > After that, Mono and .NET both used as much memory. > > Personally, every time I've had memory leaks, it was due to objects that > implement IDisposable that weren't disposed. So far, I didn't really need > to > use a profiler, as I could find out exactly when memory wasn't released by > simply using my application and watching memory usage. > > > Maciej Paszta wrote: > > > > On Thu, May 13, 2010 at 7:07 PM, Matt Dargavel > > wrote: > > > >> Hi there, > >> > >> > >> > >> We have an application written in Mono that appears to > be > >> leaking memory. I’ve tried using the profiler and mprof-heap-viewer to > >> identify any objects that are being left around, but I couldn’t see > >> anything > >> significant. The application doesn’t seem to leak on .NET, so I was > >> starting to wonder about the Boehm GC. Will using the heap snapshots > >> show > >> any objects that are no longer being referenced, but have not been > >> Garbage > >> Collected? Also, is there a way to enable the heap profiler but only > for > >> heap snapshots using the telnet interface- i.e. without the allocations > >> info > >> as these generate huge amounts of data in a soak test. Finally, does > >> anyone > >> have any other suggestions on where else I should look / other > >> diagnostics > >> to try? > >> > >> > >> > > I have experienced similar behavior. When app was running under .NET the > > memory was freed, but switching to Mono caused memory to climb up. I did > > some investigation but I couldn't find anything wrong with the code - I > > had > > tried all profilers available for mono. The I gave my app a little time > > and > > memory was eventually freed but after a longer period of time - maybe > it's > > the same situation? > > > > > > -- > > Maciej Paszta > > > > ___ > > Mono-devel-list mailing list > > Mono-devel-list@lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > > > -- > View this message in context: http://mono.1490590.n4.nabble.com/Garbage- > Collection-Issue-tp2197862p2216258.html > Sent from the Mono - Dev mailing list archive at Nabble.com. > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Garbage Collection Issue?
This happened to me too, but I found the cause. It was a disposable object that I replaced with another one without disposing of it first. In my case, I found out doing the following gave the best results as far as memory is concerned: myobj.Dispose(); myobj = null; myobj = newobj; Without setting the object to null, memory is fred later. After that, Mono and .NET both used as much memory. Personally, every time I've had memory leaks, it was due to objects that implement IDisposable that weren't disposed. So far, I didn't really need to use a profiler, as I could find out exactly when memory wasn't released by simply using my application and watching memory usage. Maciej Paszta wrote: > > On Thu, May 13, 2010 at 7:07 PM, Matt Dargavel > wrote: > >> Hi there, >> >> >> >> We have an application written in Mono that appears to be >> leaking memory. I’ve tried using the profiler and mprof-heap-viewer to >> identify any objects that are being left around, but I couldn’t see >> anything >> significant. The application doesn’t seem to leak on .NET, so I was >> starting to wonder about the Boehm GC. Will using the heap snapshots >> show >> any objects that are no longer being referenced, but have not been >> Garbage >> Collected? Also, is there a way to enable the heap profiler but only for >> heap snapshots using the telnet interface- i.e. without the allocations >> info >> as these generate huge amounts of data in a soak test. Finally, does >> anyone >> have any other suggestions on where else I should look / other >> diagnostics >> to try? >> >> >> > I have experienced similar behavior. When app was running under .NET the > memory was freed, but switching to Mono caused memory to climb up. I did > some investigation but I couldn't find anything wrong with the code - I > had > tried all profilers available for mono. The I gave my app a little time > and > memory was eventually freed but after a longer period of time - maybe it's > the same situation? > > > -- > Maciej Paszta > > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > -- View this message in context: http://mono.1490590.n4.nabble.com/Garbage-Collection-Issue-tp2197862p2216258.html Sent from the Mono - Dev mailing list archive at Nabble.com. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Garbage Collection Issue?
On Thu, May 13, 2010 at 7:07 PM, Matt Dargavel wrote: > Hi there, > > > > We have an application written in Mono that appears to be > leaking memory. I’ve tried using the profiler and mprof-heap-viewer to > identify any objects that are being left around, but I couldn’t see anything > significant. The application doesn’t seem to leak on .NET, so I was > starting to wonder about the Boehm GC. Will using the heap snapshots show > any objects that are no longer being referenced, but have not been Garbage > Collected? Also, is there a way to enable the heap profiler but only for > heap snapshots using the telnet interface- i.e. without the allocations info > as these generate huge amounts of data in a soak test. Finally, does anyone > have any other suggestions on where else I should look / other diagnostics > to try? > > > I have experienced similar behavior. When app was running under .NET the memory was freed, but switching to Mono caused memory to climb up. I did some investigation but I couldn't find anything wrong with the code - I had tried all profilers available for mono. The I gave my app a little time and memory was eventually freed but after a longer period of time - maybe it's the same situation? -- Maciej Paszta ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Garbage Collection Issue?
On Thu, May 13, 2010 at 2:59 PM, Bryan Murphy wrote: > On Thu, May 13, 2010 at 12:07 PM, Matt Dargavel > wrote: >> Finally, does anyone have any other suggestions on where else I should look >> / other diagnostics to try? > > You might want to try heap-buddy, although it's been quite some time > since I've been able to get it to compile. > > http://www.mono-project.com/HeapBuddy There's also heap-shot, which works fine with 2.6, as long as you use a SVN revision from around the time 2.6 was branched. Heap-shot can be used to snapshot the heap and examine the objects that are there, what objects they reference, and what objects reference them. It can also show the difference between heap snapshots. -- Michael Hutchinson http://mjhutchinson.com ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Garbage Collection Issue?
On Thu, May 13, 2010 at 12:07 PM, Matt Dargavel wrote: > Finally, does anyone have any other suggestions on where else I should look / > other diagnostics to try? You might want to try heap-buddy, although it's been quite some time since I've been able to get it to compile. http://www.mono-project.com/HeapBuddy Bryan ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Garbage Collection Issue?
Hi there, We have an application written in Mono that appears to be leaking memory. I've tried using the profiler and mprof-heap-viewer to identify any objects that are being left around, but I couldn't see anything significant. The application doesn't seem to leak on .NET, so I was starting to wonder about the Boehm GC. Will using the heap snapshots show any objects that are no longer being referenced, but have not been Garbage Collected? Also, is there a way to enable the heap profiler but only for heap snapshots using the telnet interface- i.e. without the allocations info as these generate huge amounts of data in a soak test. Finally, does anyone have any other suggestions on where else I should look / other diagnostics to try? Thanks In Advance, Matt. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list