Quite severe memory leak when using unicode = true

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Quite severe memory leak when using unicode = true

Post by DarrenColes » Fri 22 Jun 2007 11:10

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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Sat 23 Jun 2007 06:14

Unfortunately, I cannot reproduce memory leak. What tool do you use to count memory usage?

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Sun 24 Jun 2007 20:08

just by watching the memory usage in task manager

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Tue 26 Jun 2007 10:14

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.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 26 Jun 2007 14:05

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?

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Tue 26 Jun 2007 14:52

thanks, I have sent a compiled exe to the support email address.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 26 Jun 2007 16:57

OK, I will take a look.

DarrenColes
Posts: 51
Joined: Mon 28 Aug 2006 11:07

Post by DarrenColes » Wed 27 Jun 2007 14:14

Ive upgraded oracle client to 9.2.0.6 and this appears to have solved the issue.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 27 Jun 2007 14:48

Very well.

Post Reply