I am using an array in C# like so:
class abc
{
xyz x = new xyz(); // some other class
public double [] arr = new double [100]; // Allocated 400 bytes
// for this array.
// 100 is imaginary size
// shown here for simplicity.
// Actual size will depend on input.
private void something()
{
x.funA(arr);
}
}
In class abc above array is consuming 400 bytes. Now, I have passed this array in some function as a parameter which is in class xyz.
My question is whether new 400 bytes will be allocated in class xyz. 400 bytes is not that much of concern, but in my program I am passing an array which is taking one MB.
The amount of memory that is needed to store a reference. As far as I remember, it is 8 bytes on a 32-bit machine and 12 bytes on a 64-bit machine.