[Mono-list] Heap-Shot with no GUI.

Esben Laursen hyber at hyber.dk
Thu Nov 18 10:24:09 EST 2010


Den 11-11-2010 17:10, Paolo Molaro skrev:
> On 11/05/10 Esben Laursen wrote:
> <snip>
>          Heap shot 5 at 14.518 secs: size: 43684432, object count: 562907, class count: 543
>               Bytes      Count  Average Class name
>            10506984      87373      120 System.Collections.Hashtable.Slot[] (bytes: +1939272, count: +16161)
>                  87346 references from: System.Collections.Hashtable
>             8130304      87486       92 System.Int32[] (bytes: +1706912, count: +16164)
>                  87346 references from: System.Collections.Hashtable
>                  40 references from: System.Collections.Generic.Dictionary<System.String,System.Int32>
>                  30 references from: System.Globalization.NumberFormatInfo
>             6846000      57050      120 System.Web.Caching.CacheItem (bytes: +1232880, count: +10274)
>             4891432      87347       56 System.Collections.Hashtable (bytes: +904176, count: +16146)
>                  28526 references from: System.Web.HttpStaticObjectsCollection
>                  28525 references from: System.Threading.ReaderWriterLock
>                  28524 references from: System.Web.SessionState.SessionStateItemCollection
>             1597344      28524       56 System.Web.SessionState.InProcSessionItem (bytes: +287672, count: +5137)
>                  28524 references from: System.Web.Caching.CacheItem
>             1597344      28524       56 System.Web.SessionState.SessionStateItemCollection (bytes: +287616, count: +5136)
>                  28524 references from: System.Web.SessionState.InProcSessionItem
>
> This heapshot was taken 14.518 seconds after application startup, at the
> time there were 562907 objects in the heap, of 543 different types,
> using about 43 MB of memory.
>
> As the data inside parens shows, since the previous heapshot, a lot of
> hash tables are kept around referenced mostly from
> HttpStaticObjectsCollection, ReaderWriterLock and
> SessionStateItemCollection objects.
> Following the data, SessionStateItemCollection objects are kept alive by
> InProcSessionItem which are themselves kept alive from CacheItem
> objects. The issue here is that some cached objects are never expired
> from the cache.
>
> Hope this helps.
> (Yes, someone is developing a GUI so the above data will be easier to
> understand).

Hi Lupus,

I have now installed mono-2.9 and I can get the stats you have shown 
me.. Thanks..

Here is my output:

Allocation summary
      Bytes      Count  Average Type name
  378194872      83939     4505 System.Byte[]
   84780720    1535870       55 System.String
   30132672    1883292       16 
System.Threading.Timer.Scheduler.<SchedulerThread>c__AnonStorey3
   27052704     375732       72 
System.Runtime.Remoting.Messaging.AsyncResult
   21040880     375730       56 System.Threading.WaitCallback
   14159440     516991       27 System.Object[]
    6178744     133815       46 System.String[]

It looks like its the "System.Byte[]" type where I have my leak. However 
is there someway that I can see what methos or class that is originates 
from? I use Bytes[] several places, but I cannot seem to find the place, 
as I only use them inside methods that should be destroyed my GC when it 
has finished.

Hope that you can help :-)

Cheers

Esben




More information about the Mono-list mailing list