I've read in V8 wiki that there's large object space in heap which is not moved by GC.
Large-object-space: This space contains objects which are larger than the size limits of other spaces. Each object gets its own mmap'd region of memory. Large objects are never moved by the garbage collector.
Then how does V8 handle that objects? So if I have object like this
function Point() {
this.a = new Array(99999999).join("aaaaaaaaaa");
this.b = new Array(99999999).join("aaaaaaaaaa");
this.c = new Array(99999999).join("aaaaaaaaaa");
}
var a = new Point();
it will be moved to large object space and never cleaned by GC?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…