Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Done
-
None
-
None
Description
In some browsers, using the Image object to read images from data URIs results in a memory leak outside of the JavaScript heap. This behavior has been observed in at least Chrome and some versions of Firefox, perhaps also Safari and IE. The main symptoms of the issue are:
- Memory consumption of the browser/tab process increases relatively consistently.
- JavaScript heap consumption does not increase, instead following the expected GC sawtooth pattern with an overall upper bound.
From the original description of this JIRA issue:
In SSH protocol, executing Python scripts will constantly render and refresh the interface, resulting in a gradual increase in browser memory, and finally browser crash.
The script content is in the attachment.
Execute script instructions:python pysh.py 1024 1
It is possible to avoid using Image on platforms which support createImageBitmap(). While prior tests leveraging Blob showed significant reductions in performance, those tests used createObjectURL() to load the image from the Blob. The decrease in performance doesn't appear to occur for createImageBitmap().