Maximum object children on node js [duplicate]

别等时光非礼了梦想. 提交于 2021-01-20 07:58:30

问题


I'm aware that the ECMA script spec says that an object can have infinite children however I also understand many ECMA script implementations do not conform to this. I was wondering if node has a limit on the amount of children an object can have?

Thanks, Ed.


回答1:


Yes it can but until heap out of memory.

var a = {};
var i = 0;
while(true){
    a[i] = null;
    i++;
}

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

So it depends on your memory size.



来源:https://stackoverflow.com/questions/54220438/maximum-object-children-on-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!