Out of Memory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H

I have three functions, each one uses a connection to get information, I close that connections when the functions finish. I call the function every 10 seconds. But I sometimes get an exception

ERROR [S1001] [INTERSOLV][ODBC ]Out Of Memor
ERROR [IM005] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_DBC faile

How to avoid this exception

Regard
J.C.
 
* "=?Utf-8?B?SnVhbiBDYXJsb3MgR29uemFsZXo=?= said:
I have three functions, each one uses a connection to get information, I close that connections when the functions finish. I call the function every 10 seconds. But I sometimes get an exception:

ERROR [S1001] [INTERSOLV][ODBC ]Out Of Memory
ERROR [IM005] [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_DBC failed

How to avoid this exception?

Your question is not related to .NET Windows Forms programming, you may
want to turn to this group:

ADO.NET group:

<
 
Juan,

Are you just closing and opening the connection or disposing and creating
the connection object on every call to the function? The Garbage Collector
will not necessarily release the memory immediately, so if you are creating
a new connection object every 10 seconds you most likely run out of memory
over time.

--
Regards,
Ben S. Stahlhood II
http://weblogs.asp.net/bstahlhood/


Juan Carlos Gonzalez said:
Hi

I have three functions, each one uses a connection to get information, I
close that connections when the functions finish. I call the function every
10 seconds. But I sometimes get an exception:
ERROR [S1001] [INTERSOLV][ODBC ]Out Of Memory
ERROR [IM005] [Microsoft][ODBC Driver Manager] Driver's
SQLAllocHandle on SQL_HANDLE_DBC failed
 
I agree with Ben's statement. You could force the garbage collector to run
by entering the following statement:

GC.Collect()




Juan Carlos Gonzalez said:
Hi

I have three functions, each one uses a connection to get information, I
close that connections when the functions finish. I call the function every
10 seconds. But I sometimes get an exception:
ERROR [S1001] [INTERSOLV][ODBC ]Out Of Memory
ERROR [IM005] [Microsoft][ODBC Driver Manager] Driver's
SQLAllocHandle on SQL_HANDLE_DBC failed
 
Thank

Answering your question, yes I do, I create, open and close an object connection, in my three function

I use the Collect method after close my object connection, but I keep get the same exception. Is it correct use it like this

Can you give me an example

Regard
J.C
 
Back
Top