You have announced in some previous versions that you have managed to fix memory leak problems.
However, we are currently using the latest version (MySQL 5.50.57) and we deployed our application last week. After a few hours our servers ran into memory leak each time.
After some investigation we found out the problem is caused by datacontext which were never collected by Garbage-collector.
We have solved this problem by explicit disposing of the DataContext (by "using" statement). The problem with memory leak has never appeared again.
Of course, I understand that disposing some large objects belongs to good manners - at least. However, it should not be necessary - I assured this on MSDN articles concerning .Net LinqToSql.
So I supppose it is quite a serious bug in Devart LingToSql library.
I would really appreciate if you can check this issue responsibly.
Thank you in advance.
Memory leak problem with datacontext
Could you please describe the scenario you are using DataContexts in?
I suppose that you have a number of objects queried from the database.
Then you probably modify these objects in some way and create a new instance of DataContext to submit the changes.
If these objects are not disposed, the reference to context is held.
By the way, Microsoft decleares DataContext as the class designed to be used with the 'unit of work' pattern here:
http://msdn.microsoft.com/en-us/library ... ntext.aspx
I suppose that you have a number of objects queried from the database.
Then you probably modify these objects in some way and create a new instance of DataContext to submit the changes.
If these objects are not disposed, the reference to context is held.
By the way, Microsoft decleares DataContext as the class designed to be used with the 'unit of work' pattern here:
http://msdn.microsoft.com/en-us/library ... ntext.aspx
Not at all. We do not use anything like 'attach' methods etc.AndreyR wrote:Could you please describe the scenario you are using DataContexts in?
I suppose that you have a number of objects queried from the database.
Then you probably modify these objects in some way and create a new instance of DataContext to submit the changes.
Respectively, we use scenario which is close to the one described in this article:
http://www.west-wind.com/weblog/posts/246222.aspx
in the section "Create a per Business Object instance of DataContext".
It means, the datacontext is used usually for one or two queries. And if some objects are modified, they are always submitted by the same datacontext.
I can send you a simple test application, which we used for the investigation. This application do nothing more than create a business object with datacontext (BO has no other objects) and one simple query. This is run on the page which is executed in the iteration cycle.
If we dispose the datacontext after each query, everything is OK, otherwise allocated memory is still rising.