Memory leak when using table adapter
Posted: Tue 12 Oct 2010 23:35
In a Windows Forms application using dotConnect for PostgreSQL, I'm seeing in the Windows Task Manager memory usage for one of the postgres.exe processes continually increase with every table adapter insert and never going down until the Windows Forms application exits.
When using table adapters with dotConnect/PostgreSQL, is there something I should be doing to e.g. release connections or something else that might be affecting the memory usage of postgres.exe?
I've reduced it to a simple program to demonstrate the symptom. A database with one table, with one column. The Windows Forms application has a button called "Start" with the following code:
testdcDataSetTableAdapters.testdctableTableAdapter ta =
new TestDotConnect.testdcDataSetTableAdapters.testdctableTableAdapter();
for (int i = 0; i < 10000; i++)
ta.Insert(i);
Clicking that "Start" button causes postgres.exe to climb, over the course of half a minute or so, from 10MB to 40MB. Then it stays there until I fully exit from the Windows Forms application.
My real application needs to insert 100,000 records of about three dozen columns, and postgres.exe memory usage grows to 1GB or 2GB, often crashing the computer as this is a desktop application.
When using table adapters with dotConnect/PostgreSQL, is there something I should be doing to e.g. release connections or something else that might be affecting the memory usage of postgres.exe?
I've reduced it to a simple program to demonstrate the symptom. A database with one table, with one column. The Windows Forms application has a button called "Start" with the following code:
testdcDataSetTableAdapters.testdctableTableAdapter ta =
new TestDotConnect.testdcDataSetTableAdapters.testdctableTableAdapter();
for (int i = 0; i < 10000; i++)
ta.Insert(i);
Clicking that "Start" button causes postgres.exe to climb, over the course of half a minute or so, from 10MB to 40MB. Then it stays there until I fully exit from the Windows Forms application.
My real application needs to insert 100,000 records of about three dozen columns, and postgres.exe memory usage grows to 1GB or 2GB, often crashing the computer as this is a desktop application.