By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,261 Members | 1,317 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,261 IT Pros & Developers. It's quick & easy.

Data Types and structure Memory Usage?

P: n/a
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

Feb 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
James,

Are you asking this for PDA?

Cor
Feb 17 '06 #2

P: n/a
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

"Cor Ligthert [MVP]" <no************@planet.nl> escribió en el mensaje
news:%2****************@TK2MSFTNGP10.phx.gbl...
James,

Are you asking this for PDA?

Cor


Feb 17 '06 #3

P: n/a
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.
Feb 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.