"When calling constructor, compiler will request OS to allocate memory space to hold the new object. OS return the base address and then compiler will assign it 'this' segment."
When I come across above words in the book, some questions arise.
2. 'Compiler will request OS to allocate memory'. Does compiler request OS by translating the code into VM code? From my standpoint, compiler just do the translation stuff passively, like taking the input and providing output. Hard to imagine it is actively 'requesting' something.
One way is that the compiler includes the memory management functions into the program being compiled. When the program is launched, it is given a location in memory and has so much memory. In the old days, this might be determined by the "memory model" that the compiler was set to use.
Today the actual OS is much more involved and an OS call can be made to allocate additional memory and, as far as the process that the program is running in can tell, it's memory space has simply grown by some amount. That is not done to allocate memory for each new object that is created -- it's done to get big chunks of new memory that the program's memory manager then deals with.
Elements of both. Overall computer memory management is an OS-level task. But at that level the manager is concerned with just the total amount of memory given to a program/process as a whole. How that memory gets allocated/deallocated beyond that is up to the program/process.