Virtual opportunity to a new directive, first checks whether the parameter of the directive can be positioned in a constant pool for a symbolic reference of a class, and checks whether the class represented by the symbol reference has been loaded, parsed, and initialized. If not, the loading procedure for the corresponding class must be performed first.
After the class load check passes, the virtual machine then allocates memory for the new object. The size of the memory required by an object is fully determined after the class is loaded, and the task of allocating space to an object is equivalent to dividing a size of memory from the Java heap. Assuming that the memory in the Java heap is absolutely regular, all the used memory is put aside, the free memory is put on one side, and the pointer is placed in the middle as the indicator of the dividing point, the allocated memory simply moves that pointer to the free space beyond the distance that is equal to the object size, which is called "pointer collision". If the memory of the Java heap is not regular, the virtual machine must maintain a list of which memory blocks are available, find a large enough space in the list to be allocated to the object instance, and update the records on the list, which is called the "Idle list."
Java Virtual machine Learning-object creation