ctstone / csredis

.NET client for Redis and Redis Sentinel (2.8). Includes both synchronous and asynchronous clients.
Other
292 stars 111 forks source link

Out of memory exception comeing from the dispose function #21

Closed ofirgeller closed 10 years ago

ofirgeller commented 10 years ago

this happens once in a while when running the app locally, also it happens when running unit tests in a group when one of the tests is using csRedis.

at CSRedis.Internal.IO.SocketAsyncPool..ctor(Int32 concurrency, Int32 bufferSize) at CSRedis.Internal.RedisConnector.SocketAsyncPoolFactory() at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue() at System.Lazy`1.get_Value() at CSRedis.Internal.RedisConnector.Dispose() at CSRedis.RedisClient.Dispose()

will be happy to answer question and add data if you tell me what you want to know.

thanks.

ctstone commented 10 years ago

One of the async objects was not being referenced lazily and so was being unnecessarily instantiated on dispose(). Latest checkin should fix this assuming you arent using any csredis async methods.

ofirgeller commented 10 years ago

yes that seems to solve it. great:) are the async method not to be used yet? or were you just making a remark about diagnosing the cause of the bug?

ctstone commented 10 years ago

Async just requires allocation of buffer space which could cause OOM exception if memory is tight. Buffer is configurable in client constructor.

On Sep 1, 2014, at 12:52 AM, ofirgeller notifications@github.com wrote:

yes that seems to solve it. great:) are the async method not to be used yet? or were you just making a remark about diagnosing the cause of the bug?

— Reply to this email directly or view it on GitHub https://github.com/ctstone/csredis/issues/21#issuecomment-54015077.