Hello,
First of all, I want to say that I've been using StackExchange.Redis package for a couple of years without any problems. However, recently, I started experiencing strange memory leaks. Usually, I always used prepared LUA scripts (via LuaScript.Prepare), but after some point I had to introduce some manually generated LUA scripts. The new code I'm using looks like this:
var builder = new StringBuilder("redis.call('HMSET',");
builder.Append(...);
// build some script here and then run it as string:
_connectionMultiplexer.GetDatabase().ScriptEvaluate(builder.ToString());
After several days of running, the server memory goes above 1GB (usually it stayed around 200MB). I dumped the process a couple of times and result is the same: there are many strings (500000+) with reference count = 1 in a Hashtable bucket. I'm not sure why it's there and why it cannot be freed (the script is not prepared, so it shouldn't be cached, etc).
I have attached a couple of screenshots (from MemoScope 0.9.999).
Is there any way to fix/avoid such behavior?
PS. If you need more information please let me know.
PPS. I'm using the latest version of the NuGet package (1.2.1).
Total string count:
This is how strings look like (builder.ToString() output):
Here is the reference map for each string:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4