Bug with viewing memory profile created from BuggyBits

Memory profiling for .NET developers

Moderators: StephenC, Alex.Davies, AndrewH, melvyn.harbour

Bug with viewing memory profile created from BuggyBits

Postby sseely » Sat Aug 15, 2009 8:49 pm

Repro steps:
1. Install BuggyBits from http://blogs.msdn.com/tess/pages/net-de ... tions.aspx
2. Start Memory Profiler, setup to debug at http://localhost/BuggyBits.
3. Navigate to http://localhost/BuggyBits/News.aspx
4. Take Memory Snapshot
5. using tinyget (IIS 6.0 Resource Library), run tinyget -srv:localhost -uri:/BuggyBits/News.aspx -threads:50 -loop:20
6. Take MemorySnapshot when above completes
7. Select Common Leak Indicators/Kept in memory only by event handlers
8. Should see "Specified argument was out of the range of valid values. Parameter name:identifier"
System.ArgumentOutOfRangeException
at dq.ObjectWithIdentifier(Int32 identifier)
at bv.b()
at bv.a()
at bv.get_ConnectedToRootStrong()
at bq.get_ConnectedToStrongRoots()
at bc.get_ConnectedToStrongRoots()
at cX.Select(IGraphAnalysis analysis, IComparisonAnalysis comparison)
at cx.Select(IGraphAnalysis analysis, IComparisonAnalysis comparison)
at cW.Select(IGraphAnalysis analysis, IComparisonAnalysis comparison)
at cy.Select(IGraphAnalysis analysis, IComparisonAnalysis comparison)
at cW.Select(IGraphAnalysis analysis, IComparisonAnalysis comparison)
at e.a(IFilterPanelState , ChosenInClassGraph , IGraphAnalysis , ISnapshotComparison , Boolean )
at RedGate.Memory.Controller.ControllerState.ControllerState.get_FilteredCurrentObjects()
at RedGate.Memory.Controller.ControllerState.ControllerState.get_CategorisedCurrentObjects()
at N.a()
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at i.a(StateUpdateType )
at i.a(ControllerState )
at w.a(Object , GenericEventArgs`1 )
at W.<>c__DisplayClass3.<.ctor>b__1()
at O.b()

Alternative insteadof step 8:
8. Go to class list
9. Select class name: news_aspx
10. Select Class Reference Explorer for news_aspx. Get the following:
Tried to memory map a region beyond the end of the file
Parameter name: length
Actual value was 1008576
Details:
Tried to memory map a region beyond the end of the file.Parameter name: lengthActual value was 1008576.
System.ArgumentOutOfRangeException
at j.Map(Int64 start, Int32 length)
at bb.ReverseReferenceTable(IEnumerable`1 references)
at aO.FillReferencedByCache(ap cache)
at aN.EnsureReferenceCacheAvailable()
at aN.ObjectReferencedBy(Int32 objId)
at dx.<get_ReferencedBy>d__8.MoveNext()
at cM.<GetObjects>d__0.MoveNext()
at cp.a()
at cp.get_Categories()
at p.a(q , Boolean , NextStepOnPathDelegate , IObjectSet , DefaultGraphNodes , DefaultGraphEdges )
at p.c(q , DefaultGraphNodes , DefaultGraphEdges )
at p.b(q , DefaultGraphNodes , DefaultGraphEdges )
at p.a()
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at i.a(StateUpdateType )
at i.a(ControllerState )
at al.a(Object , GenericEventArgs`1 )
at aq.<>c__DisplayClass3.<.ctor>b__1()
at O.b()
sseely
 
Posts: 5
Joined: Sat Aug 08, 2009 8:58 pm

Postby Chris.Allen » Mon Aug 17, 2009 5:29 pm

Hi, thanks for the error report. I've had success with profiling BuggyBits on most systems so I'm sure we can get to the bottom of this. I'm investigating using the tinyget utility. In the meantime, are you able to test on an x64 machine? If that works then I think we have a issue with overflow somewhere.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby sseely » Mon Aug 17, 2009 5:58 pm

This issue appears on a Win 7 x64 box.
4GB RAM
Dell Studio XPS M13.
sseely
 
Posts: 5
Joined: Sat Aug 08, 2009 8:58 pm

Postby Chris.Allen » Tue Aug 18, 2009 3:43 pm

Thanks. I couldn't get it not to work but my colleagues could. It has really helped us reproduce an issue we've been searching hard for so thank you. And watch this space, we should have some updates soon...
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby AndrewH » Wed Aug 19, 2009 11:18 am

I've been looking into this, and it appears to be an issue caused by a bug in the .NET profiling interface. Some of the int32 arrays being allocated by BuggyBits are not being reported by .NET as objects to the profiler, although the objects that reference them are (and are apparently still valid as objects and not candidates for garbage collection). I suspect there's a configuration element to this issue as well, which is why it does not show up on everyone's system.

You can see this yourself by looking at the class list and comparing the count of System.Int32[] objects to News_aspx objects: there should be at least as many arrays as pages, but when this bug occurs there are typically around 100 'missing' arrays.

I'm looking into ways to work around this; unfortunately, it's not easy to recover the missing results, which means that they will likely appear as free space.

What I have found that works is disabling the server garbage collector as described here: http://support.microsoft.com/kb/911716 - I'm not sure if the bug is directly connected to this. There may still be circumstances where this can happen with workstation GC, and this is not an ideal fix as it changes the garbage collector behaviour.

This bug can also manifest as a CouldNotMapFileException, with an IOException code of 0x8 - the same workaround should work.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Memory Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests