Giter Club home page Giter Club logo

Comments (6)

jayarjo avatar jayarjo commented on August 14, 2024

Not sure in what part of this I should look into? Do you want to say that moxie.image.Image doesn't release memory even after it is destroyed?

from moxie.

buddycat75 avatar buddycat75 commented on August 14, 2024

Exactly
I do also test with original Plupload Exemple and if you generate 10 thumbs images (6mb each) you reach more then 500Mbyte memory in FireFox or Chrome

Destroy method do not free memory
(THANKS for your time ;-) )

from moxie.

buddycat75 avatar buddycat75 commented on August 14, 2024

Hi jayarjo,

Did you investigate about my issue ? I still have a lot of memory leaks problems

Thanks in advance

from moxie.

jayarjo avatar jayarjo commented on August 14, 2024

@buddycat75 no, still have no clue. While I did track down some zombie references in the heap, they didn't seem to contribute that much to the overall memory usage. It still continues to crawl up quickly (Firefox even managed to crash couple of times, when usage of memory exceeded 2gb). However if they survive initial load, memory usage eventually drops. And since there's no way to force garbage collection from javascript, I'd conclude here that that's simply the way those browsers are designed. They eat up memory as fast as possible while it's available and start to garbage collect only when there's a shortage of it.

Suggestions are welcome.

from moxie.

jayarjo avatar jayarjo commented on August 14, 2024

Some issues that might have caused memory leaks were fixed now. Also for those browsers that support blob uris, we will be using that, so won't have to preload as string and then convert.

from moxie.

catester avatar catester commented on August 14, 2024

FYI, I found a bug which may be also causing @buddycat75's problem.

I noticed that after using image.getAsDataURL, I could not destroy the runtime when I called uploader.destroy() for Flash and Silverlight. The runtime.client was 1 and never 0 and as a result, Flash and Silverlight shims were still on the browse button.

In moxie/runtime/flash/image/Image (which is also inherited by Silverlight) I noticed there is a ghost blob object which is not destroyed anywhere so it causes the Flash and Silverlight runtimes to think there is still some connected object so they are not completely destroyed. I fixed by destroying the temp blob object before returning the dataUrl string:

getAsDataURL: function() {
    var self = this.getRuntime()
    , blob = self.Image.getAsBlob.apply(this, arguments)
    , frs
    ;
    if (!blob) {
        return null;
    }
    frs = new FileReaderSync();

    /**FIX**/
    //Fix memory leak for Flash and Silverlight, runtime is not destroyed because this blob is not destroyed
    var dataUrl = frs.readAsDataURL(blob);
    blob.destroy();
    return dataUrl;
    /** FIX **/
}

Note this problem was observed in moxie v1.5.7

from moxie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.