}
list.add(bb);
System.out.println(i);
}
}
public static void main(String[] args) throws IllegalArgumentException,
IllegalAccessException {
byteBufferAllocate(true);
// unsafeAllocate();
}
}
Hotspot Java内存空间结构
新生代(Young Generation)
大部分的对象的内存分配和回收在这里完成。
Eden
新建的对象分配在此,minor GC后被清空。
Survivor
存储至少经过一次GC存活下来的对象,以增大该对象在提升至老生代前被回收的机会。
From Space
在minor GC后被清空,GC后存活的对象放入老生代。
To Space
Eden中在新生代GC后存活的对象放在此。
老生代(Old Generation)
多次GC后存活的对象或者新生代放置不下的大对象。
永生代(PermanentGeneration)
方法区。