Skip to content

Image Memory Leak #150

Closed
Closed
@drwheeler

Description

@drwheeler

This simple little loop chews through all the memory on my Debian box. I'm nulling the Image instance every time through.
Running with node --trace_gc tst6.js shows that garbage collection is happening but this script will use 2GB of memory in short order then get killed. In real life the interval would be 10s

...

setInterval(timestampImage, 100);

function timestampImage() {
var cameraImage = new Image;

cameraImage.onload = onLoad;
cameraImage.onerror = function(err) {
                          console.log(err);
                      };

cameraImage.src = blackJpeg;

cameraImage = null;

}

function onLoad() {

...

Put the image in a canvas, add a text timestamp, save

...

}

https://gist.github.com/1720778#file_timestamp.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions