After profiling my application, I have found that my ASP .NET web application is never freeing up programatically created UltraWebGrids. The ASPX code and the Page_Load's pseudo are below.
Using ANTS Profiler I navigated to the page that has the grid multiple times then forced GC and took a snapshot. I found that all of the programatically created Infragistics controls were still "live".
How do I force the Infragistics controls to be GC'd?
Page_Load Pseduo-code {
grid.Clear();
grid.Columns.Clear();
grid.Rows.Clear();
// programattically create UltraWebGridColumns, UltraGridRows, and UltraGridCells and setting their styles, and other attributes.
}
<asp:Content ID="ContentPlaceHolder_FooTab" runat="server" ContentPlaceHolderID="ContentPlaceHolder_FooTab"> <asp:Panel ID="pnlFooPopup" runat="server" Style="display: none;" CssClass="modalPopup framePopup" Width="300px" Height="300px"> <iframe id="iframeFooPopup" frameborder="0" width="100%" height="100%" src="PopupEmpty.htm"> </iframe> </asp:Panel> <div class="tabContent"> <asp:UpdatePanel ID="upd_Foo" runat="server" EnableViewState="true" RenderMode="Block"> <ContentTemplate> <igtbl:UltraWebGrid ID="grd_Foo" runat="server" Width="100%" OnDeleteRow="grd_Foo_DeleteRow"> <Bands> <igtbl:UltraGridBand> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout AllowColumnMovingDefault="None" AllowDeleteDefault="No" AllowColSizingDefault="Fixed" AllowSortingDefault="No" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" Name="UltraWebGrid1" RowSelectorsDefault="No" SelectTypeRowDefault="Extended" StationaryMargins="HeaderAndFooter" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" GridLinesDefault="NotSet" RowAlternateStylingDefault="False" ColWidthDefault=""> <FrameStyle BackColor="Window" BorderColor="InactiveCaption" Width="100%" /> <RowStyleDefault Cursor="Default" Font-Strikeout="False" /> <HeaderStyleDefault Wrap="true" /> <AddNewBox Hidden="False"> <BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </BoxStyle> </AddNewBox> <ActivationObject BorderColor="" BorderWidth=""> </ActivationObject> </DisplayLayout> </igtbl:UltraWebGrid> </ContentTemplate> </asp:UpdatePanel> </div></asp:Content>
My standard grid settings are:
DisplayLayout AllowColSizingDefault:FreeAllowColumnMovingDefault:OnServerAllowSortingDefault:OnClient (You might want to try OnServer)HeaderClickActionDefault:SortSingleLoadOnDemand:XMLRowsRange:50 (How Many Rows The Grid Shows At A Time)SeletTypeCellDefault:SingleSelectTypeRowDefault:SingleSortingAlgorithmDefault:BubbleSortStationaryMargins:HeaderTableLayout:FixedUseFixedHeaders:TrueXMLLoadOnDemand:Virtual
Behavior:Browser:XML
When I used this method, I was able to turn off paging because of the XmlLoadOnDemand. I played around with some of the different options to get to this configuration. Just ran a quick test and using this setup, my dataset I am returning has 11k rows. This loads and shows the first set of rows in around 2-3 seconds. Since I am also working with a large amount of data, I use a filter row to minimize database hits. Hope this helps.
Have you tried setting LoadOnDemand to XML and XMLLoadOnDemandType to Virtual?
I found that this helped quite a bit when working with a ton of data.
Ian
There has not been a follow up, and frankly, in the last year or so I have not heard of complications regarding server-side memory leaks. But then again, we will gladly investigate anything and try to figure out what is going on.
I just want to let you know that sometimes the grid is not responsible for huge memory usage, since it just happens to be the presentation control that is bound to a huge datasource and it is actually the datasource that does most of the damage. So maybe you can use some sort of paging directly in your data retrieving layer (ORM, stored procedure, etc).
But agains - it reallly depends - if you can share some details what happens we will gladly try to provide aditional suggestions.