Is there a upper bound limitation on ArrayList in C#?

  • Thread starter Thread starter Quentin Huo
  • Start date Start date
Q

Quentin Huo

Hi:

I need make a calculation from database and the result may have 20,000,000
records which format is just a string. Can I add them into an ArrayList
object one by one? Is there any upper limitation on ArrayList object?

Even there is no limit, I don't think this is not a good solution. It must
take much memory. Any suggestion?

Thanks

Q.
 
Well, you're limited only by memory, but that's quite a few strings. It
would take a long time to read all that into memory and would probably
consume all your memory and a lot of swap space.

You don't describe the calculation you need to make. If you describe what it
is you're trying to do as well as tell us what kind of database it is
(Access, SQL Server, etc), we can probably provide a better solution.

Pete
 
The hard limit would appear to be Int.MaxValue as int is used for things
like count and the indexer.
 
Quentin,

I would only ask meself those questions when my reference would exceed an
integer conform the used processor. I assume that that is the address width
that forever is used in Net classes.

However, when you have calculated the values, from an extraction from your
database, why don't you than not just calculate them everytime new?

Cor
 
Back
Top