Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak #18

Closed
vclteam opened this issue May 16, 2015 · 5 comments
Closed

memory leak #18

vclteam opened this issue May 16, 2015 · 5 comments

Comments

@vclteam
Copy link

vclteam commented May 16, 2015

i tested jimp on hundreds of images. and im keep getting out of memory.

any chances that there is a problem?

@oliver-moran
Copy link
Collaborator

Can you post the smallest possible test case and I'll take a look? Thanks.

@oliver-moran
Copy link
Collaborator

OK, I've done some testing. It's very easy to run out of memory doing something like this:

for (var i = 0; i < 10000; i++) {
    var lenna = new Jimp("lenna.png", function (err, image) {
        // asynchronous callback
    });
}

That's because you will really rapidly load 10,000 odd images into memory and try to work with them all at once. The correct thing to do is to load one image, work with it, and then (when you are done) load the next.

Is this what is happening for you?

@vclteam
Copy link
Author

vclteam commented May 18, 2015

im still checking it.
but at the moment im getting out of memory on 6 images running simultaneously. (all of them are less then 1 mb)

@oliver-moran
Copy link
Collaborator

I've tested opening, manipulating and saving > 160,000 images. Didn't come across a leak.

Any joy on a test case?

@vclteam vclteam closed this as completed Jun 1, 2015
@vclteam
Copy link
Author

vclteam commented Jun 1, 2015

looks ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants