Uploaded image for project: 'Guacamole'
  1. Guacamole
  2. GUACAMOLE-884

Avoid Image where possible without performance penalty

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: guacamole-common-js
    • Labels:
      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().

        Attachments

        1. 001.png
          1.61 MB
          jianfeng chen
        2. CorrectCode.png
          277 kB
          jianfeng chen
        3. firefox.png
          2.02 MB
          jianfeng chen
        4. guac-js-heap.png
          16 kB
          Mike Jumper
        5. pysh.py
          0.8 kB
          jianfeng chen

          Activity

            People

            • Assignee:
              mjumper Mike Jumper
              Reporter:
              chenjf jianfeng chen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: