You mention the constructor specifically, like it is some special case, it is not. When it comes to memory allocation there is no difference whether your code is in a constructor or method.
Lets go though how the memory allocation works, kinda.
public class AClass
{
private int _myField;
public AClass()
{
int i = 0;
_myFields = 0;
AClass aClass = new AClass();
}
public static AClass Create()
{
int i = 0;
AClass aClass = new AClass();
aClass._myField = 0;
return aClass;
}
}
1 - is stored on the stack
2 - is stored in the heap
3 - the reference is stored on the stack and the object is stored on the heap.
4 - is stored on the stack
5 - the reference is stored on the stack, and the object is stored on the heap.
6 - is stored in the heap
As I said this is how it kinda works, and I say kinda because you can't be 100% sure of the storage location.
Microsofts implementation of C# stores all short-lived values on the stack or registers and long-lived values on the heap. Those that the compiler is short-lived is assumed to be long-lived.
One important thing to note. Many books and other sources say value types are always stored on the Stack, this is
not true. Value types are only stored on the Stack when they are short-lived.
If you're using some other C# implementation like Mono all that is stated above is null and void. Mono might do the exact same thing, it most likely does not. For all I know Mono stores all memory in the Heap.