samedi 21 mars 2015

Memory leak in SQLite for C#?

I'm using sqlite in C#. To test the performance when the size of database goes large, I write a program to generate random data, which ran out of memory. I found I have created a new IDbCommand instance by



IDbCommand cmd = dbConnection.CreateCommand() ;


method for every new insert, and that's where the memory leaks. And if I call `



cmd.Dispose();`


after executing the SQLCommand, everything is OK. Usually, there won't be large number of operations, so I don't mind the time lose of creating new Command instance for every operation. But if the memory won't be disposed, that's a problem.


Is that my duty to call cmd.Dispose() or it's a bug of sqlite-net?


Aucun commentaire:

Enregistrer un commentaire