Skip to content

Buffer and ArrayBuffer-based objects trigger mark-sweeps instead of scavenges #1671

Closed
@ChALkeR

Description

@ChALkeR

Testcase:

'use strict';

var count = 0, limit = 800000;

function call() {
    var _buffer = new Buffer(16 * 1024);
    count++;
    if (count > limit) {
        process.exit(0);
    }
    setImmediate(call);
}

for (var i = 0; i < 20; i++) {
    call();
}

var gcs = new (require('gc-stats'))();
gcs.on('stats', function(stats) {
    console.log(JSON.stringify(stats));
});

You could see that this causes a lot of gctype: 2 GC events.

Metadata

Metadata

Labels

bufferIssues and PRs related to the buffer subsystem.memoryIssues and PRs related to the memory management or memory footprint.performanceIssues and PRs related to the performance of Node.js.v8 engineIssues and PRs related to the V8 dependency.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions