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

Avoid Image where possible without performance penalty

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Done
    • None
    • 1.2.0
    • guacamole-common-js
    • 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. pysh.py
          0.8 kB
          jianfeng chen
        2. guac-js-heap.png
          16 kB
          Mike Jumper
        3. firefox.png
          2.02 MB
          jianfeng chen
        4. CorrectCode.png
          277 kB
          jianfeng chen
        5. 001.png
          1.61 MB
          jianfeng chen

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: