Bug with viewing memory profile created from BuggyBits
sseely
Posts: 7
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()
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()
Comments
4GB RAM
Dell Studio XPS M13.
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.
Software Developer
Red Gate Software Ltd.