SQL provider: SSL Provider, error: 0 - Not enough memory is available to complete this request

960 views
Skip to first unread message

nik

unread,
Jun 18, 2010, 11:30:39 AM6/18/10
to nhusers
The other day my ASP.NET application threw an OutOfMemoryException not
related to SQL Server. About a minute later, .NET garbage collection
kicked in and decreased the memory usage by 50%. The application then
started throwing the below exception, but there appeared to be plenty
of available Private bytes for the w3wp process. We had to recycle
the application before we could connect to the SQL Server. Why didn't
the SQLConnection have enough memory to allocate resources? We are
using Nhibernate to connect to SQL server and passing open sql
connection to sessionfactory.OpenSession(sqlConnection). We are
diposing session after we are done with connection but we are not
closing connection explicity. W are relying on NHibernate Session to
close the connection as we disposing the session.

**Exception:**
System.Data.SqlClient.SqlException: A connection was successfully
established with the server, but then an error occurred during the pre-
login handshake. (provider: SSL Provider, error: 0 - Not enough memory
is available to complete this request)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean
encrypt, Boolean trustServerCert, Boolean& marsCapable)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout,
Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
integratedSecurity, SqlConnection owningObject)
at
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject)
at
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance,
SqlConnection owningObject, SqlConnectionString connectionOptions,
Int64 timerStart)
at
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String
newPassword, Boolean redirectedUserInstance)
at
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance)
at
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection)
at
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()

Jason Dentler

unread,
Jun 18, 2010, 11:46:42 AM6/18/10
to nhu...@googlegroups.com
Your problem is right here:

"We are using Nhibernate to connect to SQL server and passing open sql connection to sessionfactory.OpenSession(sqlConnection). We are
diposing session after we are done with connection but we are not
closing connection explicity. W are relying on NHibernate Session to
close the connection as we disposing the session."

When you pass in a connection to NHibernate, NHibernate assumes you will manage it. It will not close or dispose the connection for you. Your application probably crashed because you had a ton of open, orphaned connections eating up free memory.



--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.


Fabio Maulo

unread,
Jun 18, 2010, 11:47:06 AM6/18/10
to nhu...@googlegroups.com
If you pass a connection to the OpeneSession is because YOU WANT TO BE RESPONSIBLE about connection management.

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.




--
Fabio Maulo

Reply all
Reply to author
Forward
0 new messages