Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Memory problem

Memory problem

Scheduled Pinned Locked Moved ASP.NET
questioncssdatabasealgorithmsperformance
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shajeel
    wrote on last edited by
    #1

    Hi I have a data table with around 10 millions of row, currently it is shown throught a datagrid with previous next paging option and sorting. When this data table is loaded in code for grid, it takes around 400 mb and if there are multiple sessions whole application can go up to around 2 GB, currently data table is stored in session b/c sorting requires table. if i dont store it in session then every sort takes huge time to get data from database. what is the way around. I looked at a sample of caching but i think if i m storing 400mb of data table into it most of the time it will drop it. what can be the way around?

    Regards Shajeel

    E E 2 Replies Last reply
    0
    • S Shajeel

      Hi I have a data table with around 10 millions of row, currently it is shown throught a datagrid with previous next paging option and sorting. When this data table is loaded in code for grid, it takes around 400 mb and if there are multiple sessions whole application can go up to around 2 GB, currently data table is stored in session b/c sorting requires table. if i dont store it in session then every sort takes huge time to get data from database. what is the way around. I looked at a sample of caching but i think if i m storing 400mb of data table into it most of the time it will drop it. what can be the way around?

      Regards Shajeel

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      Create a paging procedure of your own.... Loading for example 100 rows max per page, in stead of loading the entire rows collection at once..

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      S 1 Reply Last reply
      0
      • E Eduard Keilholz

        Create a paging procedure of your own.... Loading for example 100 rows max per page, in stead of loading the entire rows collection at once..

        .: I love it when a plan comes together :. http://www.zonderpunt.nl

        S Offline
        S Offline
        Shajeel
        wrote on last edited by
        #3

        i m using asp.net datagrid with its paging. there are only 20 rows per page and previous next to move from 1 to onwards, problem is when i load whole data in data table memory of aspnet_wp process shoots. i want to keep the table so that when sorting i dont have to get data from database.

        Regards Shajeel

        1 Reply Last reply
        0
        • S Shajeel

          Hi I have a data table with around 10 millions of row, currently it is shown throught a datagrid with previous next paging option and sorting. When this data table is loaded in code for grid, it takes around 400 mb and if there are multiple sessions whole application can go up to around 2 GB, currently data table is stored in session b/c sorting requires table. if i dont store it in session then every sort takes huge time to get data from database. what is the way around. I looked at a sample of caching but i think if i m storing 400mb of data table into it most of the time it will drop it. what can be the way around?

          Regards Shajeel

          E Offline
          E Offline
          ednrgc
          wrote on last edited by
          #4

          It's not a memory problem. It's a programming problem. Don't retrieve 10 million rows at one time.

          E S 2 Replies Last reply
          0
          • E ednrgc

            It's not a memory problem. It's a programming problem. Don't retrieve 10 million rows at one time.

            E Offline
            E Offline
            Eduard Keilholz
            wrote on last edited by
            #5

            That's exactly what I said... load the rows required to display on the current page, not more, not less...

            .: I love it when a plan comes together :. http://www.zonderpunt.nl

            1 Reply Last reply
            0
            • E ednrgc

              It's not a memory problem. It's a programming problem. Don't retrieve 10 million rows at one time.

              S Offline
              S Offline
              Shajeel
              wrote on last edited by
              #6

              then how can i use it with datagrid now i m using DataTable dt = GetDataTableFromDB(); grid.DataSource = dt; grid.DataBind(); Session["dt"] = dt; this data table contains all the rows based on search criterea and which can be 10 million, then in sortcommand event i m using DataTable dt = (DataTable)Session["dt"]; DataView dv = dt.DefaultView; //Sort criterea grid.DataSource = dv; grid.DataBind();

              Regards Shajeel

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups