Reputation: 523
is the same as an array? i have a Jagged Arrays like the next one:
double numbers[][]=numbers[a][]
where "a" can be any number. how can i find out the maximum size for the jagged array.
i have read that it has been limited by the amount of memory or virtual memory available but how can i calculate this if mi PC has a 8 GB in RAM memory.
my main goal is to find out how much memory my program is using but i have no idea how to began to find the amount of physical or virtual memory been used
Upvotes: 1
Views: 1037
Reputation: 21887
The maximum size of a single array (any standard array, such as int[]
) is System.Int32.MaxValue
. Which means your jagged array can hold int.MaxValue
of int.MaxValue
items.
This link from SO has a great answer regarding the max size of arrays.
Upvotes: 1
Reputation: 273514
It's usually the wrong question.
And it's different when you run a 32 or 64 bits system.
In a 32 bits system you have a 2GB total limit (half of the available address space), under 64 bits it is virtually unlimited.
main goal is to find out how much memory my program is using
That is different. You can start with GC.GetTotalMemory();
Upvotes: 2