Memory problem
-
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
-
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
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
-
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
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
-
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
-
It's not a memory problem. It's a programming problem. Don't retrieve 10 million rows at one time.
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
-
It's not a memory problem. It's a programming problem. Don't retrieve 10 million rows at one time.
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