Home All Groups Group Topic Archive Search About

Data Types and structure Memory Usage?

Author
17 Feb 2006 9:19 AM
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

Author
17 Feb 2006 9:51 AM
Cor Ligthert [MVP]
James,

Are you asking this for PDA?

Cor
Author
17 Feb 2006 10:39 AM
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

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> escribió en el mensaje
news:%23C9LTe6MGHA.3064@TK2MSFTNGP10.phx.gbl...
> James,
>
> Are you asking this for PDA?
>
> Cor
>
>
Author
18 Feb 2006 9:30 PM
Mattias Sjögren
>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

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.