DOM Nodes forever growing while navigating to the same pages - Interactive Blazor Server - Azure SignalR #59591
Unanswered
aschildmeyerSTR
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can anyone explain to me how the DOM nodes with Blazor Server projects are supposed to know how to reuse node data and deploy Garbage Collection (GC) to trim the nodes/memory back down?
Example -
2024-12-20_14-41-38.mp4
In that video, it is about 2 minutes long. As you'll see, my DOM nodes increment at about the same rate with really no cleanup. I'm just navigating to the same page repeatedly, let the page fully load, navigate to it again. Not doing a full refresh where it recreates a new circuit. However, I did test full page refreshes, and the same behavior exists as this video when doing that. I have gotten those DOM counts upwards to 500,000 with no GC happening. When taking a memory snapshot, I see the same objects repeatedly. If you're navigating to different pages, it also just keeps stacking that DOM node/memory number.
Did we forget to do something on server-side code to do some DOM magic? Or is the Blazor Server framework supposed to be handling this? And if it is handling it then why doesn't GC engage? I did look at some public internet examples using Blazor Server, validated they were using WebSocket's, though don't know if they were SignalR based, or Azure SignalR based. Those internet test sites worked as I expected, either they GC right away or after a few times they cleaned up back to the initial DOM node number.
Also, if you know of some good docs, I can read that about how the browser interaction works while using Interactive Blazor Server that would be neat.
Beta Was this translation helpful? Give feedback.
All reactions