473,657 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Huge arrays?

VS 2003
VB.net
Win2000 SP4

The System.Array class seems to be limited to 32 bit addresses,
meaning that one can only assign 2^32 elements.

Is there any way that I can have an array that allows 2^64 elements?
Or doesn't the CLR support this on a 32 bit opsys?
I suspect that I am going to have to make such a beastie myself...

What about sparse arrays?
Nov 21 '05 #1
6 2451

Can I ask what you want to use such a beast for?

"Michael Gray" <fl****@newsguy .spam.com> wrote in message
news:d8******** *************** *********@4ax.c om...
VS 2003
VB.net
Win2000 SP4

The System.Array class seems to be limited to 32 bit addresses,
meaning that one can only assign 2^32 elements.

Is there any way that I can have an array that allows 2^64 elements?
Or doesn't the CLR support this on a 32 bit opsys?
I suspect that I am going to have to make such a beastie myself...

What about sparse arrays?

Nov 21 '05 #2
Use a database to store this many elements, as collections are also limited
by an Integer. You could ofcourse use several arrays or collections.

"Michael Gray" <fl****@newsguy .spam.com> skrev i melding
news:d8******** *************** *********@4ax.c om...
VS 2003
VB.net
Win2000 SP4

The System.Array class seems to be limited to 32 bit addresses,
meaning that one can only assign 2^32 elements.

Is there any way that I can have an array that allows 2^64 elements?
Or doesn't the CLR support this on a 32 bit opsys?
I suspect that I am going to have to make such a beastie myself...

What about sparse arrays?


Nov 21 '05 #3
Michael,
In addition to the other comments:

| The System.Array class seems to be limited to 32 bit addresses,
| meaning that one can only assign 2^32 elements.
..NET 1.1 has "support" for large arrays in that there is an Array.LongLengt h
property (Int64) & Array.GetValue & Array.SetValue are overloaded for Long
(Int64).

http://msdn.microsoft.com/library/de...engthTopic.asp

http://msdn.microsoft.com/library/de...alueTopic3.asp

| Is there any way that I can have an array that allows 2^64 elements?
| Or doesn't the CLR support this on a 32 bit opsys?
However! other then sparse arrays, which I'm not sure how much support
there is, how would you actually allocate said array? Remember that under 32
bit OS you can only index 4G of memory, of which the OS wants to keep 2G (1G
on some OSes) for itself, the runtime, your code, the stack, and other data
is going to use up part of the usable 2G, so the actually size of an Array
is going to be much smaller.

If I truly needed an "array" that is larger the 512M or so, I would consider
defining a new Type that used a file for the actual backing of the data &
read & write each element as needed. I would consider caching the elements
if performance became a problem. You could define this Type such that it
behaved like most normal collections.

Alternatively I have defined "Sparse Arrays", where I keep the "index" &
elements in a HashTable...
BTW: .NET 2.0 http://lab.msdn.microsoft.com/vs2005/ includes both a 32bit &
64bit runtime, so on a 64bit OS with the 64bit runtime you can have
obnoxiously large arrays... Whether you should or not is another discussion
;-)

Hope this helps
Jay

"Michael Gray" <fl****@newsguy .spam.com> wrote in message
news:d8******** *************** *********@4ax.c om...
| VS 2003
| VB.net
| Win2000 SP4
|
| The System.Array class seems to be limited to 32 bit addresses,
| meaning that one can only assign 2^32 elements.
|
| Is there any way that I can have an array that allows 2^64 elements?
| Or doesn't the CLR support this on a 32 bit opsys?
| I suspect that I am going to have to make such a beastie myself...
|
| What about sparse arrays?
Nov 21 '05 #4
On Thu, 7 Jul 2005 11:20:04 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************ @msn.com> wrote:
Michael,
In addition to the other comments:

| The System.Array class seems to be limited to 32 bit addresses,
| meaning that one can only assign 2^32 elements.
.NET 1.1 has "support" for large arrays in that there is an Array.LongLengt h
property (Int64) & Array.GetValue & Array.SetValue are overloaded for Long
(Int64).

http://msdn.microsoft.com/library/de...engthTopic.asp

http://msdn.microsoft.com/library/de...alueTopic3.asp

| Is there any way that I can have an array that allows 2^64 elements?
| Or doesn't the CLR support this on a 32 bit opsys?
However! other then sparse arrays, which I'm not sure how much support
there is, how would you actually allocate said array? Remember that under 32
bit OS you can only index 4G of memory, of which the OS wants to keep 2G (1G
on some OSes) for itself, the runtime, your code, the stack, and other data
is going to use up part of the usable 2G, so the actually size of an Array
is going to be much smaller.

If I truly needed an "array" that is larger the 512M or so, I would consider
defining a new Type that used a file for the actual backing of the data &
read & write each element as needed. I would consider caching the elements
if performance became a problem. You could define this Type such that it
behaved like most normal collections.

Alternativel y I have defined "Sparse Arrays", where I keep the "index" &
elements in a HashTable...
BTW: .NET 2.0 http://lab.msdn.microsoft.com/vs2005/ includes both a 32bit &
64bit runtime, so on a 64bit OS with the 64bit runtime you can have
obnoxiously large arrays... Whether you should or not is another discussion
;-)

Hope this helps
Jay


Ah, that's the answer that I was looking for...
Thanks to the other posters as well.

I knew that this rather strange request would prompt the same reaction
that I initially had: Why? and wouldn't you be better off doing it
another way?
The answers to which are: It was an enquiry to eliminate lingering
doubts, and Yes.

I really only wanted huge sparse arrays, ala FORTRAN, but noticed
these 64 bit addressing functions for System.Array objects(Getvalu e &
SetValue), but was then thrown by not being able to index them as
such, except via these special functions.

They "appeared" to have 64 bit addressing, only very much "under the
hood" as it were.

It just seemed strange to me that Microsoft would go to all the
trouble of allowing 64 bit addresses in System.Array, and then going
through hoops to cover it up, by forcing the default indexing schemes
to 32 bit! (At least in VB.Net anyway)

Thanks for all your replies, problem will be solved another way...
Nov 21 '05 #5
On Thu, 7 Jul 2005 13:37:42 +0100, "Robin Tucker"
<id************ *************@r eallyidont.com> wrote:

Can I ask what you want to use such a beast for?

I don't really, but want huge sparse arrays, such as FORTRAN provides.
See my other reply for more info...
Nov 21 '05 #6
On Thu, 7 Jul 2005 16:30:23 +0200, "Inge Henriksen"
<in************ @booleansoft.co m> wrote:
Use a database to store this many elements, as collections are also limited
by an Integer. You could ofcourse use several arrays or collections.

:
Thanks for taking the time to reply.
See my lengthier response to J.B. Harlow for more details, if you are
interested.
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
7038
by: Fabian | last post by:
Are there any speed issues in javascript with having really large arrays? I know if the array gets large enough, bandwidth and download time can be an issue, but does it take inordinate amounts of time to access a really large array? -- -- Fabian Visit my website often and for long periods!
4
2362
by: t | last post by:
Hello, I am going to write a program to search for prime numbers. There will be a lot of clients participating in this searching so I have to operate on very huge numbers, bigger than can be stored in double... I wonder how can I deal with this numbers? Do I have to create an array of doubles or ints? How could I make calculations on numbers stored in such an array? Could you give me some ideas? Or maybe you could send me source of any
3
2118
by: dpriver | last post by:
I have to initialize a huge constant array of structures(60000~100000), used as a lookup table , but it failed with System.InvalidProgramException when the items reach 18400. and if I change the item type from struct to class, the threshold is 35000 . It seems that there a size limition when initialize constant in CLR. Is there any configurable parameters can be used to increase this limition in C# compiler or .NET framework. Or I'm...
4
1830
by: RubenDV | last post by:
I am trying to make a cipher with a 256-bit key but i have no idea how the store this key without using arrays of ints or something like that. I just need a type that is big enough to hold the entire key, because i am going to use multiplication operations and such, which i can impossibly use on arrays or so i think. Is there a way to treat an array as a single, huge number without really being that? Any help is appreciated!
1
2691
by: Reynardine | last post by:
I am calling a C/C++ DLL from C# and I am marshalling the parameters to the API call by doing a type conversion for each parameter. For example, here is my C++ API method : short int XENO_API XcDatabaseCodes ( HWND hwnd, char FAR * pszDatabase, char FAR * HUGE * FAR * pszItemCategories
6
3172
by: ad | last post by:
I have a huge sting array, there are about 1000 element in it. How can I divide the huge array into small ones, and there are one 10 elements in a small one array?
8
2295
by: luke.yolanda | last post by:
is anyone know how to implement a huge 2-D array? such as ' unsigned char a; ' I compile and run it in VC 6.0, but it show me an error.... thank you guys
1
2148
by: vipinvarkey | last post by:
hello; i need to create a very long array in c of the foll specification: a however i get an error telling that the array's size is too large.the help file advices either to use malloc or huge can anyone help me how to use "huge"command? any other methods without using pointers is recommended. Thanking you; Vipin
8
2009
by: sarega | last post by:
Hi, I have two very huge arrays, the second array contains some of the elements of array1 and also different elements, both are not of the same size, have to find only the elements that are not common in both the arrays, I used array_diff but its not working can some body help me with this?? Thanks in advance
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.