Page 1 of 1

Quite severe memory leak when using unicode = true

Posted: Fri 22 Jun 2007 11:10
by DarrenColes
When i execute this piece of code

OracleConnection oc = new OracleConnection();
oc.ConnectionString = "pooling = false";
oc.Unicode = true;
oc.AutoCommit = true;
oc.Server = "development";
oc.UserId = "user";
oc.Password = "pass";
oc.Open();

OracleCommand o2 = oc.CreateCommand();
o2.CommandType = CommandType.Text;

o2.CommandText = "drop table abc";
try
{ o2.ExecuteNonQuery(); }
catch
{}

o2.CommandText = "create table abc (a varchar2(4000))";
o2.ExecuteNonQuery();

o2.CommandText = "select a from abc where 1 = -1";
for (int i = 0; i < 10000; i++)
{
OracleDataReader or = o2.ExecuteReader();
or.Read();
or.Close();
or.Dispose();
or = null;
}

o2.Dispose();
o2 = null;
oc.Close();
oc.Dispose();
oc = null;

GC.Collect();

Memory usage starts at say around 30mb and gradually rises to around 300mb.

As you can see the query doesnt even return any rows, and the amount of memory used appears to increase/decrease depending on the size of the varchar field that I create.

This does not happen with unicode = false.

Posted: Sat 23 Jun 2007 06:14
by Alexey
Unfortunately, I cannot reproduce memory leak. What tool do you use to count memory usage?

Posted: Sun 24 Jun 2007 20:08
by DarrenColes
just by watching the memory usage in task manager

Posted: Tue 26 Jun 2007 10:14
by DarrenColes
Is there anything we can do to help with diagnosing this issue, as its quite important for us as we have a project which relies on unicode support and runs as a windows service and its part of a system that requires 24x7 uptime.

Posted: Tue 26 Jun 2007 14:05
by Alexey
just by watching the memory usage in task manager
I was using task manager too.
What is the versions of OraDirect .NET, Oracle Server and Oracle Client?
Can you send me your compiled test project where I could type my connection information and reproduce the problem?

Posted: Tue 26 Jun 2007 14:52
by DarrenColes
thanks, I have sent a compiled exe to the support email address.

Posted: Tue 26 Jun 2007 16:57
by Alexey
OK, I will take a look.

Posted: Wed 27 Jun 2007 14:14
by DarrenColes
Ive upgraded oracle client to 9.2.0.6 and this appears to have solved the issue.

Posted: Wed 27 Jun 2007 14:48
by Alexey
Very well.