Solved

Does Visual Basic have an array size limit?

Posted on 2004-03-23
7
1,624 Views
Last Modified: 2010-05-18
I am using VB6 on Windows XP. I have some arrays that are 7 by 6 million. I found through experimentation that increasing my RAM from 512M to 1G allowed me to get an array of 6 million. If I increase my RAM some more, can I increase my array size or does VB put some numerical limit on the size of an array?

thanks!

jeff
0
Comment
Question by:jscharpf
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 10659502
Not certain... but it seems like it's 64K (so it would depend on what you are storing in the array:

see here:

http://www.nsbasic.com/palm/info/technotes/TN08.htm
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 10659565
HOWEVER, i just tried it... and i did an array of 50000 strings whiich is well over the constraints the above link mentions. I know in c/c++ array size is theorhetically limited by amount of stack space. I'll do some more research
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 10659643
after further research, i couldn't find anything in MSDN nor google. I'm gonna go out on a limb and say the max size of the array is dependant on the amount of memory you have available.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:jscharpf
ID: 10659646
So far I've done 6 million single precision numbers..
I was at 4 million until I upgraded my RAm..
This is why I ask what the limit is. 64 thousand is definitely not correct.

Jeff
0
 
LVL 9

Expert Comment

by:_ys_
ID: 10661243
Given that the LBound / UBound pair can return Long values, we potentially have a very big array.
0
 

Author Comment

by:jscharpf
ID: 10661333
I guess I have to accept that :)
0
 
LVL 1

Expert Comment

by:j_chakraverty
ID: 10672100
Hi seems an answer is accepted but i'd like to leave a few comments

[1]
all platforms and programming language has a theoratical uppel limit to every aspect of it. and a practicle upper limit too which is mostly lower than the
whatever it is it is certainly a power of (2^n)-1
[2]
VB or any programming language will not put any upper limit ( unless it is a workaround for some bug in compiler or interpreter) such upper limits are OS governed

[3]
When we test arrays we do so with a code that does nothing else in practicle thats rarly the case.

[4]
with array the ram usage increases exponantially. I do not remember the source but i do remember reading it in a book




0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question