-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't clear internal BLToolKit cache explicitly #286
Comments
The ExecuteList method does not cache anything. |
Usually GC takes as much memory as it can if other applications do not need it. So, I do not think this is a problem. |
It's very strange... Why when I do this: using (var dbManager = new DBManager())
{
while (true) // ~ 10 millions objects total, 10,000 objects in one iteration
{
objects = dbManager.SetCommand(fullQuery, ...params...).ExecuteList();
}
} Memory usage grows up to 1Gb (and my app throw OutOfMemoryException), but if I do this: while (true) // ~ 10 millions objects total, 10,000 objects in one iteration
{
using (var dbManager = new DBManager())
{
objects = dbManager.SetCommand(fullQuery, ...params...).ExecuteList();
}
}
|
i'v done mostly the same test: static void Main(string[] args)
{
using (var db = new DbManager())
{
for (int i = 0; i < 10000; i++)
{
var e = db.SetCommand("select * from transactiondetail").ExecuteList<Trans>();
}
Console.ReadLine();
} and have no problem with memory for ex. i'v faced with memory leak by event handlers when cached objects are subscribed to events of "selected" objects |
Thanks, i'll try it. |
mostly it should not mean... please, tell about results, it is interesting case |
What profiler should I use? Standart PerfMonitor? |
any .Net memory profiler, i think dotTrace for ex |
Hello, Igor!
I have some troubles with reading big data. For example, I do that:
while (true)
{
objects = dbManager.SetCommand(fullQuery, ...params...).ExecuteList();
}
As you can see, each iteration clears reference on previos data block. GC periodically clears the memory. But after 2 hours proccess takes almost 1Gb RAM!
I suppose that readed objects cached in some internal cache of BLTK. Am I right? In EntityFramework this situation resolves by "no tracking changes" flag. Here I have to dispose DBManager every cicle iteration. Is there another way? Some dbManager.ClearCache ? :-)
The text was updated successfully, but these errors were encountered: