Data Types and structure Memory Usage?

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi,

I need info about how much memory different data types (particulary
bitarrays, listarray, ...) and structures uses (including overhead). Is
there any place where I can find that info (article, paper, ...).

Thanks,
James
 
Hi Cor,

I need this for a regular vb.net program. I am using quiet a few structures
and bitarrays, Example:
If I use 1 Million bitarrays of length 8, I supposed this will be using:
1 Million x 1 byte + 1 Million pointers of 4 bytes = 5 Mbytes
Is that correct, or there any additional overhead (example: does bitarray
keep the lenght of each bitarry in a variable)?

What is the difference if I used a structure or a Jagged array, is there any
additional overhead?

Thanks,

Jaime
 
If I use 1 Million bitarrays of length 8, I supposed this will be using:
1 Million x 1 byte + 1 Million pointers of 4 bytes = 5 Mbytes
Is that correct, or there any additional overhead (example: does bitarray
keep the lenght of each bitarry in a variable)?

The BitArray internally stores the bits in an Integer array. For only
8 bits a single element array is enough. In addition to the array
reference the class has two private Integer variables (and in v2.0
there's also an Object variable). I can't say exactly what the total
memory required is for each BitArray is since I don't know what the
array descriptor overhead is, but on a 32-bit system it probably sums
up to around 40-50 bytes.


Mattias
 
Back
Top