I have a code like following:
TransactionOptions topt = new TransactionOptions();
topt.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
topt.Timeout = new TimeSpan(0, 0, 60);
for(int i = 0; i < 10000; i++)
{
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, topt))
{
using (ObjectContext db = new ObjectContext (_ConnectionString))
{
var query = from tb in tablename
select ...
EntityName entity = query.FirstOrDefault();
}
ts.Complete()
}
}
_ConnectionString is using OCI client mode (Direct=false), I found it will cause memory leak when I run this code second, third times after previous run immediately. Memory will not be released, even though waited it for a long time .
If TransactionScopeOption.Suppress, there was no memory leak problem.
If I adjust transactionscope timespan to 3~5 seconds, memory leak will not be obvious.
If I add 'Pool=false' into connection string. There was no memory leak problem.
Finally, I add 'Connection Lifetime=600' into my connection string. Memory was be returned every 600 seconds.
My oracle client: 10.2.0 or 11.1.0
Devart: 5.60.124
OS: Windows Server 2003 sp2
Visual Studio 2008 sp1
May be connection Pool problem?
The new build of dotConnect for Oracle 5.70.152 is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=18588.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=18588.