Replies: 5 comments 2 replies
-
@BrennanConroy PTAL |
Beta Was this translation helpful? Give feedback.
-
What do the thread stack traces look like? Are you able to share the dump or the app, or any other information? |
Beta Was this translation helpful? Give feedback.
-
Hi thanks for your help, to make sure the issue lies with signalr i tried serializing the object manually with
This also seems to cause the same issue. So I think the issue lies with System.Text.Json and signalr is not the culprit. |
Beta Was this translation helpful? Give feedback.
-
Here are the objects i'm trying to serialize (i've taken out (what i think) are simple and uninteresting properties.
The new dump i have after using the system.text.json show a slightly different situation with
Part of the gcroot (total 62 unique roots) I can post the complete if interested
|
Beta Was this translation helpful? Give feedback.
-
Having tested on a slightly smaller set, it seems recursion is indeed the problem, a situation with 10 cameras and 2 tags containing all cameras results in a single camera being present ~500 times in the resulting json. |
Beta Was this translation helpful? Give feedback.
-
Hi I think there is a problem with signalr consuming huge amounts of memory.
I have an asp.net setup with signalr. At some point (not sure when exactly) memory usage spikes from a consist 15-25 mb to 3-4 gb. The dumps show that that is entirely caused by byte arrays[]. I am not able to reproduce the issue on my local machine, only on the production machine.
70b02531a150 292,067 4,864,317,945 System.Byte[]
dumpheap -type System.Byte[] shows a ton of 16/32KB byte[] (small part shown below).
gcroot for each of these objects shows 39 unique roots with each similar to
I'm not sure what causes this. I am not sending large messages (not more than 1 entity), the only thing that i can think of is circular references, but that should be disabled by IgnoreCycles (as shown below)
After adding swap memory it held long enough to arrive at the following error message
System.ArgumentException: Destination is too short. (Parameter 'destination')
at Microsoft.AspNetCore.Internal.MemoryBufferWriter.ToArray()
at Microsoft.AspNetCore.SignalR.Protocol.HubProtocolExtensions.GetMessageBytes(IHubProtocol hubProtocol, HubMessage message)
at Microsoft.AspNetCore.SignalR.SerializedHubMessage.GetSerializedMessage(IHubProtocol protocol)
at Microsoft.AspNetCore.SignalR.HubConnectionContext.WriteCore(SerializedHubMessage message, CancellationToken cancellationToken)
Beta Was this translation helpful? Give feedback.
All reactions