M
Mariano Vicario
Hi all,
We are having a memory leak, in our application. The problem
is that we only can reproduce it 3 times. And we cannot find the
pattern of this bug.
In our application when the user finishes one special section, an
automatically full backup is executed (If the users setup it in this
way).
Our backup does this:
///close all DReaders, Dcomad's, and connections to de DB
SqlCeEngine engine = new SqlCeEngine("Data Source = DB.sdf"));
engine.Compact("Data Source='"DBBK.sdf ";");
engine.Dispose();
/// open connection again to the DB.sdf
The error we log is this:
Error Message:
Not enough storage is available to complete this operation.
Stack Trace:
at System.Data.SqlServerCe.SqlCeEngine.ProcessResults()
at System.Data.SqlServerCe.SqlCeEngine.Repair()
at System.Data.SqlServerCe.SqlCeEngine.Compact()
at Backup.CompactDatabaseBackUp()
at Backup.CreateBackUp()
at BackUpControl.DoBackUp()
We are using CF 2.0, and the bug was reproduce with a 3 MB DB.
As I tell you before, this happens occasionally. So I don't know what
to do, I call the GC.Collect or GC.WaitForPendingFinalizers always
before SqlCeEngine.Compact is call?, or do I have any way to know how
memory is at the moment, and if is necessary I call GC.Collect ?
Thanks,
Mariano Vicario
www.ranu.com.ar
We are having a memory leak, in our application. The problem
is that we only can reproduce it 3 times. And we cannot find the
pattern of this bug.
In our application when the user finishes one special section, an
automatically full backup is executed (If the users setup it in this
way).
Our backup does this:
///close all DReaders, Dcomad's, and connections to de DB
SqlCeEngine engine = new SqlCeEngine("Data Source = DB.sdf"));
engine.Compact("Data Source='"DBBK.sdf ";");
engine.Dispose();
/// open connection again to the DB.sdf
The error we log is this:
Error Message:
Not enough storage is available to complete this operation.
Stack Trace:
at System.Data.SqlServerCe.SqlCeEngine.ProcessResults()
at System.Data.SqlServerCe.SqlCeEngine.Repair()
at System.Data.SqlServerCe.SqlCeEngine.Compact()
at Backup.CompactDatabaseBackUp()
at Backup.CreateBackUp()
at BackUpControl.DoBackUp()
We are using CF 2.0, and the bug was reproduce with a 3 MB DB.
As I tell you before, this happens occasionally. So I don't know what
to do, I call the GC.Collect or GC.WaitForPendingFinalizers always
before SqlCeEngine.Compact is call?, or do I have any way to know how
memory is at the moment, and if is necessary I call GC.Collect ?
Thanks,
Mariano Vicario
www.ranu.com.ar