zoukankan      html  css  js  c++  java
  • 用Table在页面上显示2万条数据,占用内存300M。用windbg看看内存都给了谁(二):Table

         上回说了Viewstate,为什么会用到那么多Viewstate呢,与这回要说的Table大有关系,注意,此Table乃System.Web.UI.WebControls.Table,服务器端控件,非HTML的<table>。

         此篇涉及以下对象

    0x04428964          1           100 System.Web.UI.WebControls.Table
    0x0442a52c          1            28 System.Web.UI.WebControls.Table/RowControlCollection
    0x04429b3c          1            12 System.Web.UI.WebControls.TableRowCollection
    0x04429094     23,170     2,317,000 System.Web.UI.WebControls.TableRow
    0x044297f4     23,170       278,040 System.Web.UI.WebControls.TableCellCollection
    0x0442a45c     23,170       648,760 System.Web.UI.WebControls.TableRow/CellControlCollection
    0x044293b4    509,740    48,935,040 System.Web.UI.WebControls.TableCell
    0x040c4b64    509,744    14,272,832 System.Web.UI.ControlCollection
    0x0442a334    509,740    20,389,600 System.Web.UI.WebControls.TableItemStyle
    0x040c3f14    509,761    38,741,836 System.Web.UI.LiteralControl
    0x0442252c    509,744     6,116,928 System.Web.UI.WebControls.FontInfo
    0x04428c9c    517,396     6,208,752 System.Web.UI.WebControls.HorizontalAlign

        先从System.Web.UI.WebControls.Table开始解剖。

    0:000> !dumpheap -mt 0x04428964

    Loading the heap objects into our cache.
       Address         MT     Size  Gen
    0x01630780 0x04428964      100 2 System.Web.UI.WebControls.Table


    0:000> !dumpobj 0x01630780

    Name: System.Web.UI.WebControls.Table
    MethodTable 0x04428964
    EEClass 0x042f8450
    Size 100(0x64) bytes
    GC Generation: 2
    mdToken: 0x02000226  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    FieldDesc*: 0x044287d8
            MT      Field     Offset                 Type       Attr      Value Name
    0x03cf0784 0x4000b48      0x4                CLASS   instance 0x00000000 _dataBindings
    0x03cf0784 0x4000b49      0x8                CLASS   instance 0x01630754 _id
      (String)
    0x03cf0784 0x4000b4a      0xc                CLASS   instance 0x01630754 _cachedUniqueID
    0x03cf0784 0x4000b4b     0x10                CLASS   instance 0x01630020 _parent
      (System.Web.UI.HtmlControls.HtmlForm)
    0x03cf0784 0x4000b4c     0x14                CLASS   instance 0x00000000 _site
    0x03cf0784 0x4000b4d     0x18                CLASS   instance 0x00000000 _events
    0x03cf0784 0x4000b4e     0x1c                CLASS   instance 0x04c1cbcc _controls
      
    0x03cf0784 0x4000b4f     0x38         System.Int32   instance 5 _controlState
    0x03cf0784 0x4000b50     0x20                CLASS   instance 0x00000000 _renderMethod
    0x03cf0784 0x4000b51     0x24                CLASS   instance 0x0163080c _viewState
      (System.Web.UI.StateBag)
    0x03cf0784 0x4000b52     0x28                CLASS   instance 0x00000000 _controlsViewState
    0x03cf0784 0x4000b53     0x2c                CLASS   instance 0x00000000 _namedControls
    0x03cf0784 0x4000b54     0x3c         System.Int32   instance 0 _namedControlsID
    0x03cf0784 0x4000b55     0x30                CLASS   instance 0x0162f36c _namingContainer
    0x03cf0784 0x4000b56     0x34                CLASS   instance 0x0162f36c _page
    0x03cf0784 0x4000b57     0x40            VALUETYPE   instance start at 016307c0 flags
    0x03cf0784 0x4000b42        0                CLASS     shared   static EventDataBinding
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c670 <<
    0x03cf0784 0x4000b43      0x4                CLASS     shared   static EventInit
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c67c <<
    0x03cf0784 0x4000b44      0x8                CLASS     shared   static EventLoad
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c688 <<
    0x03cf0784 0x4000b45      0xc                CLASS     shared   static EventUnload
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c694 <<
    0x03cf0784 0x4000b46     0x10                CLASS     shared   static EventPreRender
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6a0 <<
    0x03cf0784 0x4000b47     0x14                CLASS     shared   static EventDisposed
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6ac <<
    0x03cf0784 0x4000b58     0x18                CLASS     shared   static automaticIDs
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6b8 <<
    0x040c50d8 0x4000e42     0x44                CLASS   instance 0x00000000 tagName
    0x040c50d8 0x4000e43     0x54         System.Int32   instance 82 tagKey
    0x040c50d8 0x4000e44     0x48                CLASS   instance 0x00000000 attrColl
    0x040c50d8 0x4000e45     0x4c                CLASS   instance 0x00000000 attrState
    0x040c50d8 0x4000e46     0x50                CLASS   instance 0x016307e4 controlStyle
    0x040c50d8 0x4000e47     0x58            VALUETYPE   instance start at 016307d8 flags
    0x04428964 0x4000f0d     0x5c                CLASS   instance 0x04c1cbc0 rows

    起先我以为rows里是row的集合,可实际上呢?

    0:000> !do 0x04c1cbc0                                    

    Name: System.Web.UI.WebControls.TableRowCollection                                    
    MethodTable 0x04429b3c                                    
    EEClass 0x042f8780                                    
    Size 12(0xc) bytes                                    
    GC Generation: 2                                    
    mdToken: 0x02000275  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x044298f0                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x04429b3c 0x4000fe3      0x4                CLASS   instance 0x01630780 owner   

    就一个属性owner,指向的就是Table对象。

    那是哪个属性保存了row的集合呢,只剩下_controls属性了。

    0:000> !do 0x04c1cbcc                                

    Name: System.Web.UI.WebControls.Table/RowControlCollection                                
    MethodTable 0x0442a52c                                
    EEClass 0x042f8d54                                
    Size 28(0x1c) bytes                                
    GC Generation: 2                                
    mdToken: 0x02000227  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x00000000                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x040c4b64 0x4000b5d      0x4                CLASS   instance 0x01630780 _owner     (System.Web.UI.WebControls.Table)
    0x040c4b64 0x4000b5e      0x8                CLASS   instance 0x02996d18 _controls  (System.Object[])
    0x040c4b64 0x4000b5f     0x10         System.Int32   instance 23170 _size                                
    0x040c4b64 0x4000b60     0x14         System.Int32   instance 23170 _version                                
    0x040c4b64 0x4000b61      0xc                CLASS   instance 0x00000000 _readOnlyErrorMsg    
      
                             

    0:000> dd 0x02996d18                
                
    02996d18  011d209c 00014000 03cf0784 04c1a7dc                                
    02996d28  04c1cd58 04c1f5bc 04c21e00 04c24644                                
    02996d38  04c26e88 04c296cc 04c2bf10 04c2e754                                
    02996d48  04c30f98 04c337dc 04c36020 04c38864                                
    02996d58  04c3b0a8 04c3d8ec 04c40130 04c42974                                
    02996d68  04c451b8 04c479fc 04c4a244 04c4ca88                                
    02996d78  04c4f2cc 04c51b10 04c54354 04c56b98
    02996d88  04c593dc 04c5bc20 04c5e464 04c60ca8

    这个数组的容量是81920个object,实际只用了23170个,不小的浪费呢。继续查看是个什么object

    0:000> !dumpmt 03cf0784
    EEClass : 0x03ca5214
    Module : 0x001d5638
    Name: System.Web.UI.Control
    mdToken: 0x02000162  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    BaseSize: 0x48
    MethodTable Flags : 0x2040000
    Number of IFaces in IFaceMap : 0x4
    Interface Map : 0x03cf095c
    Slots in VTable : 100


    0:000> !do 04c1a7dc                                
    Name: System.Web.UI.WebControls.TableRow                                
    MethodTable 0x04429094                                
    EEClass 0x042f8654                                
    Size 100(0x64) bytes                                
    GC Generation: 2                                
    mdToken: 0x02000217  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x04428fd8                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x03cf0784 0x4000b48      0x4                CLASS   instance 0x00000000 _dataBindings                                
    0x03cf0784 0x4000b49      0x8                CLASS   instance 0x00000000 _id                                
    0x03cf0784 0x4000b4a      0xc                CLASS   instance 0x00000000 _cachedUniqueID                                
    0x03cf0784 0x4000b4b     0x10                CLASS   instance 0x01630780 _parent       (System.Web.UI.WebControls.Table)
    0x03cf0784 0x4000b4c     0x14                CLASS   instance 0x00000000 _site                                
    0x03cf0784 0x4000b4d     0x18                CLASS   instance 0x00000000 _events                                
    0x03cf0784 0x4000b4e     0x1c                CLASS   instance 0x04c1a9cc _controls                              
    0x03cf0784 0x4000b4f     0x38         System.Int32   instance 5 _controlState                                    
    0x03cf0784 0x4000b50     0x20                CLASS   instance 0x00000000 _renderMethod                                    
    0x03cf0784 0x4000b51     0x24                CLASS   instance 0x00000000 _viewState                                    
    0x03cf0784 0x4000b52     0x28                CLASS   instance 0x00000000 _controlsViewState                                    
    0x03cf0784 0x4000b53     0x2c                CLASS   instance 0x00000000 _namedControls                                    
    0x03cf0784 0x4000b54     0x3c         System.Int32   instance 0 _namedControlsID                                    
    0x03cf0784 0x4000b55     0x30                CLASS   instance 0x0162f36c _namingContainer
    0x03cf0784 0x4000b56     0x34                CLASS   instance 0x0162f36c _page
    0x03cf0784 0x4000b57     0x40            VALUETYPE   instance start at 04c1a81c flags                                    
    0x03cf0784 0x4000b42        0                CLASS     shared   static EventDataBinding                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c670 <<                                    
    0x03cf0784 0x4000b43      0x4                CLASS     shared   static EventInit                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c67c <<                                    
    0x03cf0784 0x4000b44      0x8                CLASS     shared   static EventLoad                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c688 <<                                    
    0x03cf0784 0x4000b45      0xc                CLASS     shared   static EventUnload                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c694 <<                                
    0x03cf0784 0x4000b46     0x10                CLASS     shared   static EventPreRender                                
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6a0 <<                                
    0x03cf0784 0x4000b47     0x14                CLASS     shared   static EventDisposed                                
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6ac <<                                
    0x03cf0784 0x4000b58     0x18                CLASS     shared   static automaticIDs                                
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6b8 <<                                
    0x040c50d8 0x4000e42     0x44                CLASS   instance 0x00000000 tagName                                
    0x040c50d8 0x4000e43     0x54         System.Int32   instance 90 tagKey                                
    0x040c50d8 0x4000e44     0x48                CLASS   instance 0x00000000 attrColl                                
    0x040c50d8 0x4000e45     0x4c                CLASS   instance 0x00000000 attrState                                
    0x040c50d8 0x4000e46     0x50                CLASS   instance 0x00000000 controlStyle                                
    0x040c50d8 0x4000e47     0x58            VALUETYPE   instance start at 04c1a834 flags                                
    0x04429094 0x4000edf     0x5c                CLASS   instance 0x04c1a9c0 cells   

    和之前一样,cell属性里只有一个指向TableRow的owner属性

    0:000> !do 0x04c1a9c0                                 
    Name: System.Web.UI.WebControls.TableCellCollection                                
    MethodTable 0x044297f4                                
    EEClass 0x042f871c                                
    Size 12(0xc) bytes                                
    GC Generation: 2                                
    mdToken: 0x02000273  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x044295ac                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x044297f4 0x4000fe2      0x4                CLASS   instance 0x04c1a7dc owner (System.Web.UI.WebControls.TableRow)

    老样子,看_controls属性

    0:000> !do 0x04c1a9cc                                
    Name: System.Web.UI.WebControls.TableRow/CellControlCollection                                
    MethodTable 0x0442a45c                                
    EEClass 0x042f8c3c                                
    Size 28(0x1c) bytes                                
    GC Generation: 2                                
    mdToken: 0x02000218  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x00000000                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x040c4b64 0x4000b5d      0x4                CLASS   instance 0x04c1a7dc _owner                                (System.Web.UI.WebControls.TableRow)
    0x040c4b64 0x4000b5e      0x8                CLASS   instance 0x04c1c858 _controls   (System.Object[])
    0x040c4b64 0x4000b5f     0x10         System.Int32   instance 22 _size                                
    0x040c4b64 0x4000b60     0x14         System.Int32   instance 22 _version                                
    0x040c4b64 0x4000b61      0xc                CLASS   instance 0x00000000 _readOnlyErrorMsg

    0:000> dd 0x04c1c858                                
    04c1c858  011d209c 00000050 03cf0784 04c1a840                                
    04c1c868  04c1aa58 04c1abd8 04c1ad58 04c1aed8                                
    04c1c878  04c1b058 04c1b1d8 04c1b358 04c1b4d8                                
    04c1c888  04c1b658 04c1b7d8 04c1b958 04c1bad8                                
    04c1c898  04c1bc58 04c1bdd8 04c1bf58 04c1c0d8                                
    04c1c8a8  04c1c258 04c1c3d8 04c1c558 04c1c6d8                                
    04c1c8b8  04c1c9a8 00000000 00000000 00000000
    04c1c8c8  00000000 00000000 00000000 00000000

    80的容量只用到22个,考虑到有23,170个这样的,那就浪费了23170*(80-22)*4bytes=5.1M的内存

    0:000> !dumpmt 03cf0784
    EEClass : 0x03ca5214
    Module : 0x001d5638
    Name: System.Web.UI.Control
    mdToken: 0x02000162  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    BaseSize: 0x48
    MethodTable Flags : 0x2040000
    Number of IFaces in IFaceMap : 0x4
    Interface Map : 0x03cf095c
    Slots in VTable : 100



    0:000> !do 04c1a840
    Name: System.Web.UI.WebControls.TableCell                                
    MethodTable 0x044293b4                                
    EEClass 0x042f86b8                                
    Size 96(0x60) bytes                                
    GC Generation: 2                                
    mdToken: 0x02000272  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)                                
    FieldDesc*: 0x00000000                                
            MT      Field     Offset                 Type       Attr      Value Name                                
    0x03cf0784 0x4000b48      0x4                CLASS   instance 0x00000000 _dataBindings                                
    0x03cf0784 0x4000b49      0x8                CLASS   instance 0x00000000 _id                                
    0x03cf0784 0x4000b4a      0xc                CLASS   instance 0x00000000 _cachedUniqueID                                
    0x03cf0784 0x4000b4b     0x10                CLASS   instance 0x04c1a7dc _parent  (System.Web.UI.WebControls.TableRow)
    0x03cf0784 0x4000b4c     0x14                CLASS   instance 0x00000000 _site                                
    0x03cf0784 0x4000b4d     0x18                CLASS   instance 0x00000000 _events                                
    0x03cf0784 0x4000b4e     0x1c                CLASS   instance 0x04c1a934 _controls
    0x03cf0784 0x4000b4f     0x38         System.Int32   instance 5 _controlState                                
    0x03cf0784 0x4000b50     0x20                CLASS   instance 0x00000000 _renderMethod                                    
    0x03cf0784 0x4000b51     0x24                CLASS   instance 0x04c1a8c8 _viewState  (System.Web.UI.StateBag)    
    0x03cf0784 0x4000b52     0x28                CLASS   instance 0x00000000 _controlsViewState                                    
    0x03cf0784 0x4000b53     0x2c                CLASS   instance 0x00000000 _namedControls                                    
    0x03cf0784 0x4000b54     0x3c         System.Int32   instance 0 _namedControlsID                                    
    0x03cf0784 0x4000b55     0x30                CLASS   instance 0x0162f36c _namingContainer
    0x03cf0784 0x4000b56     0x34                CLASS   instance 0x0162f36c _page
    0x03cf0784 0x4000b57     0x40            VALUETYPE   instance start at 04c1a880 flags                                    
    0x03cf0784 0x4000b42        0                CLASS     shared   static EventDataBinding                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c670 <<                                    
    0x03cf0784 0x4000b43      0x4                CLASS     shared   static EventInit                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c67c <<                                    
    0x03cf0784 0x4000b44      0x8                CLASS     shared   static EventLoad                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c688 <<                                    
    0x03cf0784 0x4000b45      0xc                CLASS     shared   static EventUnload                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c694 <<                                    
    0x03cf0784 0x4000b46     0x10                CLASS     shared   static EventPreRender                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6a0 <<                                    
    0x03cf0784 0x4000b47     0x14                CLASS     shared   static EventDisposed                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6ac <<                                    
    0x03cf0784 0x4000b58     0x18                CLASS     shared   static automaticIDs                                    
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6b8 <<                                    
    0x040c50d8 0x4000e42     0x44                CLASS   instance 0x00000000 tagName                                    
    0x040c50d8 0x4000e43     0x54         System.Int32   instance 84 tagKey                                    
    0x040c50d8 0x4000e44     0x48                CLASS   instance 0x00000000 attrColl                                    
    0x040c50d8 0x4000e45     0x4c                CLASS   instance 0x00000000 attrState                                    
    0x040c50d8 0x4000e46     0x50                CLASS   instance 0x04c1a8a0 controlStyle                                  
    0x040c50d8 0x4000e47     0x58            VALUETYPE   instance start at 04c1a898 flags   

    先看看controlStyle

    0:000> !do 0x04c1a8a0

    Name: System.Web.UI.WebControls.TableItemStyle
    MethodTable 0x0442a334
    EEClass 0x042f8ba8
    Size 40(0x28) bytes
    GC Generation: 2
    mdToken: 0x02000222  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    FieldDesc*: 0x00000000
            MT      Field     Offset                 Type       Attr      Value Name
    0x79b97904 0x40000b6      0x4                CLASS   instance 0x00000000 __identity
    0x03cf5894 0x4000503      0x8                CLASS   instance 0x00000000 site
    0x03cf5894 0x4000504      0xc                CLASS   instance 0x00000000 events
    0x03cf5894 0x4000502        0                CLASS     shared   static EventDisposed
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155d604 <<
    0x040c737c 0x4000efb     0x10                CLASS   instance 0x04c1a8c8 statebag
    0x040c737c 0x4000efc     0x14                CLASS   instance 0x153215d4 fontInfo
    0x040c737c 0x4000efd     0x20       System.Boolean   instance 0 ownStateBag
    0x040c737c 0x4000efe     0x21       System.Boolean   instance 1 marked
    0x040c737c 0x4000eff     0x18         System.Int32   instance 65536 setBits
    0x040c737c 0x4000f00     0x1c         System.Int32   instance 0 markedBits


    0:000> !do 0x153215d4

    Name: System.Web.UI.WebControls.FontInfo
    MethodTable 0x0442252c
    EEClass 0x042f28cc
    Size 12(0xc) bytes
    GC Generation: 2
    mdToken: 0x0200023a  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    FieldDesc*: 0x04422390
            MT      Field     Offset                 Type       Attr      Value Name
    0x0442252c 0x4000f46      0x4                CLASS   instance 0x04c1a8a0 owner

    FontInfo里居然只有指向TableItemStyle的owner属性,style信息存放在TableItemStyle的statebag属性了,注意了,TableItemStyle的statebag和TableCell 的_viewState指向的是同一个内存区域,一回事。

    再接着看 TableCell 的_controls

    0:000> !do 0x04c1a934

    Name: System.Web.UI.ControlCollection
    MethodTable 0x040c4b64
    EEClass 0x040f16b8
    Size 28(0x1c) bytes
    GC Generation: 2
    mdToken: 0x02000164  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    FieldDesc*: 0x040c49f8
            MT      Field     Offset                 Type       Attr      Value Name
    0x040c4b64 0x4000b5d      0x4                CLASS   instance 0x04c1a840 _owner
    0x040c4b64 0x4000b5e      0x8                CLASS   instance 0x04c1a99c _controls
    0x040c4b64 0x4000b5f     0x10         System.Int32   instance 1 _size
    0x040c4b64 0x4000b60     0x14         System.Int32   instance 1 _version
    0x040c4b64 0x4000b61      0xc                CLASS   instance 0x00000000 _readOnlyErrorMsg


    0:000> !do 0x04c1a99c

    Name: System.Object[]
    MethodTable 0x011d209c
    EEClass 0x011d2018
    Size 36(0x24) bytes
    GC Generation: 2
    Array: Rank 1, Type CLASS
    Element Type: System.Object
    Content: 5 items

    0:000> dd 0x04c1a99c

    04c1a99c  011d209c 00000005 03cf0784 04c1a950
    04c1a9ac  00000000 00000000 00000000 00000000
    04c1a9bc  00000000 044297f4 04c1a7dc 00000000
    04c1a9cc  0442a45c 04c1a7dc 04c1c858 00000000
    04c1a9dc  00000016 00000016 80000000 79b946b0
    04c1a9ec  0000001d 0000001c 00610043 006e006e
    04c1a9fc  0074006f 0048005f 00760061 005f0065
    04c1aa0c  00680043 006c0069 00720064 006e0065


    0:000> !dumpmt 03cf0784

    EEClass : 0x03ca5214
    Module : 0x001d5638
    Name: System.Web.UI.Control
    mdToken: 0x02000162  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    BaseSize: 0x48
    MethodTable Flags : 0x2040000
    Number of IFaces in IFaceMap : 0x4
    Interface Map : 0x03cf095c
    Slots in VTable : 100


    0:000> !do 04c1a950

    Name: System.Web.UI.LiteralControl
    MethodTable 0x040c3f14
    EEClass 0x040f1494
    Size 76(0x4c) bytes
    GC Generation: 2
    mdToken: 0x02000191  (c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll)
    FieldDesc*: 0x040c3e80
            MT      Field     Offset                 Type       Attr      Value Name
    0x03cf0784 0x4000b48      0x4                CLASS   instance 0x00000000 _dataBindings
    0x03cf0784 0x4000b49      0x8                CLASS   instance 0x00000000 _id
    0x03cf0784 0x4000b4a      0xc                CLASS   instance 0x00000000 _cachedUniqueID
    0x03cf0784 0x4000b4b     0x10                CLASS   instance 0x04c1a840 _parent
    0x03cf0784 0x4000b4c     0x14                CLASS   instance 0x00000000 _site
    0x03cf0784 0x4000b4d     0x18                CLASS   instance 0x00000000 _events
    0x03cf0784 0x4000b4e     0x1c                CLASS   instance 0x00000000 _controls
    0x03cf0784 0x4000b4f     0x38         System.Int32   instance 5 _controlState
    0x03cf0784 0x4000b50     0x20                CLASS   instance 0x00000000 _renderMethod
    0x03cf0784 0x4000b51     0x24                CLASS   instance 0x00000000 _viewState
    0x03cf0784 0x4000b52     0x28                CLASS   instance 0x00000000 _controlsViewState
    0x03cf0784 0x4000b53     0x2c                CLASS   instance 0x00000000 _namedControls
    0x03cf0784 0x4000b54     0x3c         System.Int32   instance 0 _namedControlsID
    0x03cf0784 0x4000b55     0x30                CLASS   instance 0x0162f36c _namingContainer
    0x03cf0784 0x4000b56     0x34                CLASS   instance 0x0162f36c _page
    0x03cf0784 0x4000b57     0x40            VALUETYPE   instance start at 04c1a990 flags
    0x03cf0784 0x4000b42        0                CLASS     shared   static EventDataBinding
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c670 <<
    0x03cf0784 0x4000b43      0x4                CLASS     shared   static EventInit
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c67c <<
    0x03cf0784 0x4000b44      0x8                CLASS     shared   static EventLoad
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c688 <<
    0x03cf0784 0x4000b45      0xc                CLASS     shared   static EventUnload
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c694 <<
    0x03cf0784 0x4000b46     0x10                CLASS     shared   static EventPreRender
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6a0 <<
    0x03cf0784 0x4000b47     0x14                CLASS     shared   static EventDisposed
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6ac <<
    0x03cf0784 0x4000b58     0x18                CLASS     shared   static automaticIDs
        >> Domain:Value 0x00155980:NotInit  0x00193830:0x0155c6b8 <<
    0x040c3f14 0x4000c7c     0x44                CLASS   instance 0x01630e5c _text


    解剖工作至此告一段落。为了这509,740个数据项,消耗了254M左右的内存在Table控件(viewstate)上,而托管堆上的对象总共也就303M。

  • 相关阅读:
    在一组降序排列的数组中插入一个数据,插入后,数组中数据依然按降序排列
    轮播图无限滚动
    微软雅黑的Unicode码和英文名
    javascript中的this
    javascript构造函数及原型对象
    object.prototype.call
    Array.prototype.forEach数组遍历
    键盘event.which属性
    Object.prototype.toString()
    parseInt()解析整数与parsetFloat()解析浮点数
  • 原文地址:https://www.cnblogs.com/wordmy/p/1431681.html
Copyright © 2011-2022 走看看