Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:07:10+00:00 2026-06-12T21:07:10+00:00

I am currently storing about a million rows into a DataTable, this takes about

  • 0

I am currently storing about a million rows into a DataTable,
this takes about 600 Mb RAM.

So, when you run the application it with store a 1 000 000 rows in a DataTable and display that on a GridView. When you close the Application this will obviously clear the memory.

I will Like to give the user this option, in other words when the user tries to close the form he will be asked whether he wants to clear memory or not.

The reason for doing this is that does not have to wait for the data to be read into the Datatable each time he runs the application.

…. I am fairly new to C#, so I apologize if this is an in appropriate question here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:07:13+00:00Added an answer on June 12, 2026 at 9:07 pm

    You can only keep something in memory if there is a running application / process with that data in memory – if your application closes (and there is only 1 instance of your application open with that data in memory) then the memory will be released. If you want to keep it in memory then your only options would be

    • Don’t close your application, e.g. just hide the window instead (generally a very bad idea that your users won’t thank you for)
    • Keep that data in another separate process that stays running even when your application isn’t, for example a Windows service (again possibly not something that your users are going to thank you for, unless you are actually trying to develop a form of service as opposed to a Windows application).

    A much better idea would be change the way your application works with large data sets so that it doesn’t need to keep it all in memory, for example if you display all of that data in a large list view then use a virtual list view so that only those rows currently being displayed to the user are loaded into memory. You can then store your data either in an external database or a semi-permanent file (such as a SQLite database).

    Or just load the data set each time like you currently are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently we are storing mysql passwords in the application.ini. As this file is in
I just noticed this about a week ago. I'm storing data about the current
I'm currently having an issue storing mouse coordinates into an array in which a
I'm currently storing various metadata about videos and one of those bits of data
I'm scanning a large data source, currently about 8 million entries, extracting on string
I am currently using this http://blogs.sitepoint.com/hierarchical-data-database-2/ method of storing my data. My current database
I have a table of about a million rows and I need to update
I need to store a customer 's currently selected payment info ,so that this
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about
I'm currently storing my sqlite db file in the App_Data folder as per ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.