Skip to content

maximum Set size in Node 24 vs Node 23. 16M vs 8M #60461

@KatSick

Description

@KatSick

Version

24.10.0

Platform

Darwin local 24.6.0 Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

Run

const infiniteSet = new Set();
let counter = 0;

for (; counter < 10000000000; counter++) {
    infiniteSet.add(`item-${counter}`);

    if (counter % 1000 === 0) {
        console.log(`Set size: ${infiniteSet.size}`);
    }
}

on Node 23 and Node 24 and Node 25.

on Node 25 - ~16M items
on Node 24 - ~8M items
on Node 23 - ~16M items

How often does it reproduce? Is there a required condition?

100% of the cases

What is the expected behavior? Why is that the expected behavior?

Same maximum Set size

What do you see instead?

Reduced Set max size in half

Additional information

Image

vs

Image

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