Web Build Becomes Unresponsive After Extended Runtime Because of Increasing JavaScript Memory Usage

Hello Unreal Engine Community,

I am currently working on a website that includes an Unreal Engine-based interactive experience, and I am facing one specific programming problem that I have been unable to resolve. The core issue is that the Unreal Engine content initially runs correctly when the page is opened, but after the experience has been running and interacted with for an extended period, the web build gradually becomes less responsive and eventually stops responding to user input. The initial loading process completes normally, the scene renders correctly, and the interactive controls work as expected during the beginning of the session. However, after repeatedly interacting with the experience, changing views, and triggering the same gameplay-related functions, performance gradually deteriorates until the embedded experience becomes extremely slow or appears frozen. Refreshing the webpage immediately restores normal performance, which makes me suspect that something is accumulating during runtime rather than there being a permanent compatibility problem with the initial build.

I have been trying to isolate the issue on the programming side because the problem does not appear immediately after the Unreal Engine content starts. The website loads the build through the browser, and the initial memory usage and performance appear reasonable. As the user continues interacting with the application, however, browser memory consumption gradually increases and does not appear to return to its original level after certain objects or gameplay states are no longer being used. I have reviewed the code responsible for creating and destroying temporary gameplay objects and have tried to make sure that objects which are no longer required are properly released. Despite this, repeated interactions seem to leave some amount of allocated memory behind. Eventually, the browser tab requires considerably more resources and the Unreal Engine content begins responding much more slowly. I am trying to determine whether this could be caused by an object lifecycle problem, retained references, delegates, timers, event bindings, or another programming pattern that prevents unused objects from being cleaned up correctly.

The problem is easiest to reproduce when the same interactive workflow is performed repeatedly. For example, if a user opens a particular part of the experience, changes the displayed content, returns to the previous state, and repeats that process many times, the memory usage gradually increases. The scene itself does not become visibly larger, and I am not intentionally spawning an unlimited number of permanent actors, so I am having difficulty understanding what is being retained. I have checked the logic associated with dynamically created objects and have attempted to destroy objects when they are no longer needed. I have also reviewed event bindings because I understand that delegates or callbacks can keep references alive longer than expected if they are not removed correctly. However, I have not yet found one specific section of the code that clearly explains why memory continues growing after the corresponding user interaction has finished.

I have also used the available browser and Unreal debugging tools to compare the application during a fresh session with its state after the performance degradation begins. The most noticeable difference is the increasing memory usage and progressively longer response time for some operations. CPU usage can increase during certain moments, but it does not remain consistently high enough to explain the complete loss of responsiveness. There are also no obvious fatal errors that cause the application to terminate. Instead, the experience continues running while becoming increasingly difficult to interact with until a page refresh is performed. This makes me think that the issue may be related to resources that remain referenced in memory rather than a straightforward infinite loop. I would like to understand which Unreal profiling tools would be most appropriate for identifying objects or allocations that survive multiple gameplay cycles when the application is deployed as a web build.

I have tried simplifying the affected functionality to see whether the problem disappears when fewer dynamic operations are performed, and the simplified version remains stable for longer. However, I still want to identify the actual programming mistake rather than simply removing functionality from the website. The project contains several systems that communicate with one another, and some of the interactive behaviour involves creating temporary objects, registering callbacks, updating UI elements, and responding to repeated user actions. I suspect that one of these lifecycle operations may be leaving references behind, but I do not know the best way to prove that this is happening. I am particularly interested in recommended Unreal Engine patterns for managing dynamically created objects and event subscriptions in a long-running interactive experience where the same functionality can be opened and closed many times.

I would appreciate guidance from the Unreal Engine community on how to systematically diagnose this specific gradual memory-growth problem in a web-deployed Unreal Engine experience. I would especially like recommendations for using Unreal’s memory and object profiling tools to identify objects that remain allocated after their expected lifetime, as well as advice on checking delegates, timers, event bindings, references, and dynamically created actors or UI objects. If there are specific commands or profiling workflows that can help compare object counts and memory allocations between a fresh session and a degraded session, I would be grateful for suggestions. My goal is to identify the programming issue responsible for the retained resources and ensure that the Unreal Engine experience remains responsive during long sessions without requiring visitors to refresh the entire website. Sorry for long post!