0

Using:

  • .NET Core 2.1.x
  • StackExchange.Redis.Extensions 4.0.5
  • messagepack c-sharp 2.3.85
  • Azure Redis
  • Azure app service

Hello, i am not sure it is a bug in the messagepack-csharp library,but i have the following problem and hopefully somebody can help me.

My Application uses MessagePack-csharp to set and get items in/from Azure Redis cache. 99.9% of the time this works fine but sometimes i get two errors which causes the CPU to go to 100% and the application crashes until i restart the application.

Related errors: The errormessages found in the logs and related to eachother are the following:

  1. Failed to deserialize System.Collections.Generic.List1[[MYOBJECT]] value. at MessagePack.MessagePackSerializer.Deserialize[T](MessagePackReader& reader, MessagePackSerializerOptions options) at MessagePack.MessagePackSerializer.Deserialize[T](ReadOnlyMemory1 buffer, MessagePackSerializerOptions options, CancellationToken cancellationToken) at CacheService.GetAsync[T](String key)
  2. Out of memory exceptions on different kind of actions (reading db items, reading jwt etc..
  3. REDIS InternalFailure on EXPIRE at Microsoft.Extensions.Caching.Redis.RedisCache.RefreshAsync(String key, Nullable1 absExpr, Nullable1 sldExpr, CancellationToken token)
  4. No connection is available to service this operation: EVAL; Exception of type 'System.OutOfMemoryException' was thrown. at StackExchange.Redis.ConnectionMultiplexer.ThrowFailed[T](TaskCompletionSource`1 source, Exception unthrownException)

Someone any clue what it can be?

--> Redis shows no memory issues, the application neither. Both only shows a maximum of 25% usage so i have no idea why i get a memory exception.

--> CPU raises up to 100% usage... Only waiting a few minutes or a restart of the application fixes the issue..

Does this ring a bell to anyone?

mkeymolen
  • 196
  • 1
  • 3
  • 14
  • Does this answer your question? [Redis Out of Memory Exceptions, but still have plenty of memory](https://stackoverflow.com/questions/52993019/redis-out-of-memory-exceptions-but-still-have-plenty-of-memory) – Ecstasy Jun 14 '22 at 12:15
  • [MessagePack-CSharp - System.OutOfMemoryException](https://github.com/neuecc/MessagePack-CSharp/issues/817) and [Timeout exceptions in StackExchange.Redis for Azure Redis Cache](https://learn.microsoft.com/en-us/answers/questions/4151/timeout-exceptions-in-stackexchangeredis-for-azure.html) – Ecstasy Jun 14 '22 at 12:18
  • Dear @DeepDave-MT thanks for your reply but it is not exactly the same.. i updated my question with more info – mkeymolen Jun 16 '22 at 14:04

1 Answers1

1

I found the answer. My Azure web app was running in 64 bit but the dotnet.exe process was still running on 32bit.

I changed the deployment to 64bit and made sure the dotnet 64bit process was executed. This fixed the out of memory exceptions.

mkeymolen
  • 196
  • 1
  • 3
  • 14