Memory Leak!

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Memory Leak!

Post by achib » Fri 15 Sep 2006 09:25

Memory Leak!

I use Oracle client 8.0.6 and DirectOracle 3.50.12.0
I detected a memory leak about 2-3 Mb in the example. Please fix this problem ASAP!

Best regards, Alexei

private void button5_Click(object sender, System.EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;

for(int i=0;i<60;i++)
{
string myConnectionString = "User Id=user;Password=pwd; Pooling = false";
OracleConnection myConn = new OracleConnection(myConnectionString);
myConn.Open();
this.GetUSR_NAME(myConn);
myConn.Close();
}


System.Windows.Forms.MessageBox.Show("Finished");
}
catch(Exception err)
{
System.Windows.Forms.MessageBox.Show(err.Message + " " + err.StackTrace);
}
finally{this.Cursor = Cursors.Default;}
}


public string GetUSR_NAME(OracleConnection conn)
{
string sRet = null;
OracleCommand cmd = new OracleCommand();
try
{
string sSQL = "SELECT user FROM dual";
cmd.CommandText = sSQL;
cmd.Connection = conn;

sRet = Convert.ToString(cmd.ExecuteScalar());
}
catch(Exception err){throw err;}
finally
{
cmd.Dispose();
}
return sRet;
}

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Fri 15 Sep 2006 09:39

I fogot, i use NET 1.1 version OraDirect

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

Post by Alexey » Fri 15 Sep 2006 10:50

What tool do you use to test memory leaks?

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Fri 15 Sep 2006 10:58

Task Manager.

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

Post by Alexey » Fri 15 Sep 2006 11:27

What makes you think that there exist memory leaks? Please specify.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Fri 15 Sep 2006 11:58

Ok. I run my test program, run my test function and when my function finished i write down memory usage (memory column in Windows Task Manager) on the paper. Then i run the function again(pressing button on the form) and again and i notice the memory usage of my test app steadily goes up.
The memory leak problem is very important for me because I use DirectOracle in my Windows Service app.

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

Post by Alexey » Fri 15 Sep 2006 12:22

I did the same before asking you. Can you post your numbers because i couldn't find signifficant difference.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Fri 15 Sep 2006 12:34

Alexey, thanks for your replies.
First of all i use Oracle Client 8.0.6 and NET1.1.
My results(kB): 23680,24912,26140,27372,... about 1100-1200 kB difference.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Fri 15 Sep 2006 13:00

Alexey, When you run the test program use Oracle Client 8.0.6 There is no memory leaks when i use client 9.0.2 and above.

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

Post by Alexey » Tue 19 Sep 2006 05:57

Try to reproduce your test without invoking GetUSR_NAME function and inform us on results.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Tue 19 Sep 2006 06:24

If i don't invoke function GetUSR_NAME everything is OK, no memory leaks.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Wed 20 Sep 2006 06:59

When i use OraDirect 2.5.3 in my test there are no memory leaks.

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

Post by Alexey » Wed 20 Sep 2006 07:17

There is no 2.5.3 version of OraDirect. Please check carefully.

achib
Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Wed 20 Sep 2006 08:37

It's your previous major version OraDirect. The file version is 2.50.3.0.

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

Post by Alexey » Wed 20 Sep 2006 09:04

OK, i see, 2.50.3, not 2.5.3.
We are investigating this problem. You will be notified on results as soon as possible.

Post Reply