Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

TORCH script with flicker-on has memory leak that causes eventual crash.

Last night I had a 4 hour session on a map which had two torches with flicker-on enabled on them. The firefox memory usage for the window rose very rapidly until it reached 12GB in size (I have 16GB installed), and then everything on the map started going wrong. This happened for multiple users, on both chrome and firefox. This was using Firefox browser.
1596027215
The Aaron
Roll20 Production Team
API Scripter
API scripts run in a sandbox on a server far removed from your browser, so if they have a memory leak, it would crash that sandbox, not your browser. I know that seems like splitting hairs, but it's important so that you can look for try real problem.  Are you using Advanced Fog of War?  It's implementation is based on adding the coordinates of squares seen for each player to a large list that is communicated to all clients, which means it grows in size exponentially as the map is explored.
1596121197

Edited 1596121340
The memory usage is in the firefox browser. Whatever the flicker-on is doing, it is causing roll20 to eat up all the memory in the browser. This is with legacy lighting, with all fog of war disabled. With no flicker-on, the browser memory remains roughly the same - it very slowly creeps up, but then resets a little (garbage collection?). With flicker-on, the browser memory is going up by around 100MB every minute or so. It reduces a tiny bit periodically, but never back to the previous level.
1596122088
The Aaron
Roll20 Production Team
API Scripter
What flicker does is create an object on the DL layer that sheds light with the requested parameters, then moves it periodically to a random location near the token it's following while also adjusting it's various radiuses by a random amount.  You might need to just discontinue use of it.  This would be a memory leak somewhere in Roll20's light code.  Possibly there is a built in assumption that light objects won't change position during some calculation, and when they do, it is finding the same light object many times, but never removing it from some hash.  I guess I'll point this out to the devs, but I wouldn't expect it to be something easily tracked down and fixed, particularly this week.
Yes, I've already stopped using the flicker. I only wish I'd worked it out during the session.