G
Guest
Hi!
First of all, I'm not quite sure if this is the right place asking this
question, it may very well be a SQL Server issue, but I'll start here.
I have a problem with the SQL Server database "running wild", consuming all
available system memory, when running a C# application that uses
OleDbConnections.
For normal operation and load, it seems to do OK, but when I do a lot of
database calls (very simple SELECT:s, but tens of thousands of them) during a
short period of time, the server memory literally goes through the roof.
Eventually, 100% of the available memory is used and the system stalls.
If stop calling the database before it stalls, the memory usage will remain
at a very high level for a period of time (at least 30 minutes), but
eventually it drops down to where it was prior to the application execution.
What I've tried to do:
- I thought it might have something to do with the database connections
being left open in a pool, but the high memory use remains even after the
application is stopped.
- I have also tried running both with and without transactions on the
connections in question, but no change.
- The 30 minute (or so) delay in memory usage drop indicated open resources
that timed out, but I have made sure that all DataReaders are closed after
use, both for normal and exception cases in the code. Apart from the
connections, does anything else have to be explicitly closed?
Has anyone experienced this with the OleDbConnection, or is it a SQL Server
only issue? Any hints or tips are greatly appreciated! Thanks!
//ecgn
First of all, I'm not quite sure if this is the right place asking this
question, it may very well be a SQL Server issue, but I'll start here.
I have a problem with the SQL Server database "running wild", consuming all
available system memory, when running a C# application that uses
OleDbConnections.
For normal operation and load, it seems to do OK, but when I do a lot of
database calls (very simple SELECT:s, but tens of thousands of them) during a
short period of time, the server memory literally goes through the roof.
Eventually, 100% of the available memory is used and the system stalls.
If stop calling the database before it stalls, the memory usage will remain
at a very high level for a period of time (at least 30 minutes), but
eventually it drops down to where it was prior to the application execution.
What I've tried to do:
- I thought it might have something to do with the database connections
being left open in a pool, but the high memory use remains even after the
application is stopped.
- I have also tried running both with and without transactions on the
connections in question, but no change.
- The 30 minute (or so) delay in memory usage drop indicated open resources
that timed out, but I have made sure that all DataReaders are closed after
use, both for normal and exception cases in the code. Apart from the
connections, does anything else have to be explicitly closed?
Has anyone experienced this with the OleDbConnection, or is it a SQL Server
only issue? Any hints or tips are greatly appreciated! Thanks!
//ecgn