Template Columns consuming memory

Discussion in 'ASP .Net Datagrid Control' started by B.J, Jul 26, 2005.

  1. B.J

    B.J Guest

    Have any of you came across memory/resource problems when using an ASP.NET
    DataGrid that is bound to a DataTable with a large resultset (9,000 rows or
    more)? Typically, you would invoke DataGrid paging for something like this,
    but "they" are not doing this. Besides, follow me through on this case:

    (Using Windows XP Pro w/ SP2 and Microsoft .Net Framework v1.1 SP1) on a
    machine with 1GB RAM and in-process Session State.

    The DataGrid is being used in two different ways. 1 version collects
    information and displays it with paging enabled. The whole resultset
    contains 10,000 records and is cached/stored. The ASP.Net worker process is
    sitting at 54MB of RAM at this point. Mind you that there are about 8
    columns, with which 3 of them are template columns, containing a TextBox,
    but combines 4 other fields to make the cell.

    Now, if show the same grid, without paging, the ASP.NET Worker Process just
    grinds away, eating up memory. It peaks at 270MB of RAM while it is
    Binding, and after the bind is complete, memory sustains at 224MB RAM. This
    memory never seems to be GC'd, and so if you run this process a few more
    times, then ASP.NET resets itself, as it used up all the memory. YIKES!
    Note, that even with ViewState off, not much difference is made here.

    Of course this problem seems to go away if I take out the template columns.
    Anyone ever experience this problem? Of course, the quick answer might be
    to not use the DataGrid, and use other means, which renders a straight HTML
    table with my output, but that DataGrid is such a sweet tool at times. Yes,
    no one in their right mind would want to show thousands of results in a darn
    table, but the issue really si about memory leaks, as if you ran my scenario
    with resultsets of 250 many times, you will recreate the issue. I suspect
    it's something to do with Templatre Collumns. Anyone?

    B.J, Jul 26, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. W. Jordan
    W. Jordan
    Nov 28, 2005
  2. Dan Simper
    Andrea Desole
    Jan 19, 2005
  3. phil

    fwrite consuming lot of memory help !!!!

    phil, Aug 5, 2005, in forum: C Programming
    Lawrence Kirby
    Aug 8, 2005
  4. Ravi

    why its not consuming memory

    Ravi, May 23, 2007, in forum: C Programming
    Eric Sosman
    May 25, 2007
  5. Vinki

    template columns and bound columns in gridview

    Vinki, Apr 25, 2007, in forum: ASP .Net Web Controls
    Apr 25, 2007

Share This Page