You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time you run File.toBytes, all of those bytes stays in memory forever. Even if never used.
Running this function on a 350MB file a couple of times will make the browser use gigabytes of RAM.
File.toString and File.toUrl does not have the same problem, those are garbage collected immidiatly
( I have tested Chrome and Firefox on Linux and get exactly the same results )
Possible solution:
Adding reader = null after it is used removes the problem on both Chrome and Firefox, with this line added I see no memory leak anymore.
The text was updated successfully, but these errors were encountered:
Every time you run File.toBytes, all of those bytes stays in memory forever. Even if never used.

Running this function on a 350MB file a couple of times will make the browser use gigabytes of RAM.
File.toString and File.toUrl does not have the same problem, those are garbage collected immidiatly

( I have tested Chrome and Firefox on Linux and get exactly the same results )
Possible solution:

Adding
reader = null
after it is used removes the problem on both Chrome and Firefox, with this line added I see no memory leak anymore.The text was updated successfully, but these errors were encountered: