Open b0ykoe opened 1 year ago
Some investigation further:
the issue seems to start here and leading into public virtual bool SendAsync(ReadOnlySpan<byte> buffer)
https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/TcpSession.cs#L314
this leads into the Buffer#Append
function and later on into the Reserve
function
https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/Buffer.cs#L194
https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/Buffer.cs#L194
and my hot take is that this one will only ever increase the size but never decrease it anymore. https://github.com/chronoxor/NetCoreServer/blob/master/source/NetCoreServer/Buffer.cs#L122
I've established a "Proxy" behaviour with NetCoreServer, code below. While this works great I've found myself in a increasing memory situation. Observing the binary with dotMemory did lead me towards NetCoreServer.
I'm using .NET 7 and the latest NetCoreServer (7.0.0).
Stacktrace from dotMemory, file attached.
dotMemory file: dotMemory - SilkroadSecurityFake_impl.zip
The dotMemory file contains a test where the
Packet
object and parsing was still enabled. Sadly the memory leak behaviour does not change while disabling it.Testcase: There about 400 clients standing moving inside each other. With a request to the server and then a response to all 400 clients that this one client moved. The Proxy receives all 400 responses and sends them to the clients. Basically 160_000 Packets every tick. I couldn't notice any strange behaviour while the memory did raise.
Code: RemoteClient
Server
Session
Program