Memory Leak!
Memory Leak!
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;
}
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;
}
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.
The memory leak problem is very important for me because I use DirectOracle in my Windows Service app.