I have a simple sqlite database with only one table and 7-8 string fields with ~2.000.000 records. Database file on disk is about 450-500mb...
When i open db file in my c# app and execute simple "select * from tbl" query, computer memory usage goes to 3gb.
Here is code i'm using to select data from database:
DataSet ds = new DataSet();
dataGridView1.DataSource = null;
string s = Cstr();
try
{
SQLiteConnection conn = new SQLiteConnection(s);
SQLiteCommand command = new SQLiteCommand(conn);
command.CommandText = "select * from log;";
conn.Open();
command.ExecuteReader();
var da = new SQLiteDataAdapter(command.CommandText, conn);
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
conn.Close();
GC.Collect();
}
catch (Exception)
{
}
I tried same thing with mysql5 db and memory usage is normal for database of that size. edit: I tried to load same sqlite database with Delphi XE5 and it uses only ~600mb of memory.
Is there any way to avoid this?