[Mono-bugs] [Bug 69607][Maj] New - [Odbc] Memory problems with OdbcDataReader.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 17 Nov 2004 10:43:21 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sebastien.robitaille@croesus.com.
http://bugzilla.ximian.com/show_bug.cgi?id=69607
--- shadow/69607 2004-11-17 10:43:21.000000000 -0500
+++ shadow/69607.tmp.15042 2004-11-17 10:43:21.000000000 -0500
@@ -0,0 +1,87 @@
+Bug#: 69607
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Red Hat 9.0
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: sebastien.robitaille@croesus.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [Odbc] Memory problems with OdbcDataReader.
+
+Description of Problem:
+
+I am using the OdbcDataReader to retrieve more that one million records
+(A table with one BINARY(16) column). Using MS.NET, this operation takes
+~40 seconds on my machine, but using Mono-1.0.4 on a Linux box (a better
+machine), it takes more than 10 minutes (I stopped the test after 10
+minutes).
+
+I suspect that this problem is related to the OdbcDataReader because
+I also did the same test using SqlClient (with a SQL Server database) on
+the same machine and it takes 30 seconds.
+
+If I run the same small test program on my Windows box using mono-1.0.4,
+the result is disastrous. The VM Size required to execute the program
+grows up to 1.6Gb and mono gives the following error message:
+
+***********************************************
+Fatal error in gc.
+Too many heap sections.
+
+(process:1116): GLib-Error(recursed)**:
+gmem.c:140:failed to allocate 40 bytes
+aborting...
+***********************************************
+
+Steps to reproduce the problem:
+1. Run the following code on a database with milions of records
+
+IDbConnection dbConnection = new OdbcConnection(connectionString);
+{
+ dbConnection.Open();
+ IDbCommand dbCommand = dbConnection.CreateCommand();
+
+ dbCommand.CommandText = "SELECT * FROM MYTABLE";
+
+ ArrayList st = new ArrayList();
+ DateTime start = DateTime.Now;
+
+ using(IDataReader reader = dbCommand.ExecuteReader())
+ {
+ while(reader.Read())
+ {
+ for(int index = 0; index < reader.FieldCount;
+index++)
+ {
+ st.Add(reader.GetValue(index));
+ }
+ }
+ }
+
+ System.Console.WriteLine((DateTime.Now - start).ToString());
+}
+
+Actual Results:
+Very very long on Linux.
+Crash on Windows.
+
+Expected Results:
+No crash. Less than one minute for the execution.
+
+How often does this happen?
+Always.
+
+Additional Information:
+
+- Mono-1.0.4
+- Sybase 12.5 database.
+- RedHat Linux 9 with freeTDS and unixODBC.
+- Windows XP Pro SP2.