Hi!
We have a application which is taking a lot of RAM and I’m trying to understand why.
Just for context, it is a single scene, not very large with most assets being loaded dynamically when a websocket event or API call happens.
Looking in windows task manager, whenever I launch the application it raises the Edge process by about 2GB right on startup, by the middle of the default loading bar it starts to ramp up quickly, so I don’t think it is the dynamically stuff doing that. We have most of our assets set to preload, so, to check if the assets were the problem I added this to the loading.js script
app.assets.on('load', (asset) => {
console.log(`Asset loaded:<<S>> ${asset.name} <<S>> ${asset.file?.size ?? "0"}`);
});
Taking everything and summing up the size, I end up with 130MB of assets being preloaded, which doesn’t explain the amount I’m seeing.
We have another scene, to test some skins, without all the connection stuff, and the result is a RAM usage increase close to 1.5GB.
Another test I did was to run the performance monitor on Edge, and the result was this:
The Heap JS is pretty high, getting to 1GB, but still far from the 2GB+ I see in the process window.
Lastly, comparing to a standard example from playcanvas, I don’t see much of a increase in RAM usage on those examples, so it is not something standard to playcanvas.
Can someone point me in a direction to understand this behavior?
Thanks!