Closed
Description
When constructing an Image, memory for that image seems to never be released:
var fs = require('fs');
var Canvas = require('canvas');
var Image = Canvas.Image;
var filename = 'image.png';
var data = fs.readFileSync(filename);
function load() {
var img = new Image;
img.onload = function() {
process.nextTick(load);
global.gc();
};
img.src = data;
}
load();
This code uses global.gc()
to force garbage collection, but even then, memory rises very quickly. When moving the var img = new Image;
to outside the load
function (and effectively reusing it) changes memory usage behavior to near constant.
Metadata
Metadata
Assignees
Labels
No labels