Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Array length more than 0x7fffffff

Posted on 2001-07-07
Medium Priority
Last Modified: 2010-04-16
How to create onedimensional array with length more than 0x7fffffff?
Question by:msterjev
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

by:Igor Bazarny
ID: 6262065

Are you sure you need such a big array. As far as I understand, such array won't fit in 32-bit address space in most cases. Why do you think you need such a huge size?

Igor Bazarny,
Brainbench MVP for Java 1 

Expert Comment

ID: 6263039
Imagine it was an array of bytes. It would consume 2GB of memory! Your problem might not even be a java problem but a problem of the underlying Operating System.
LVL 92

Expert Comment

ID: 6263777
Don't think it's possible.
Not sure what your requirments are but maybe have a look for a good Sparse Array implementation. May suit, may not :)

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Expert Comment

ID: 6272928
Short answer: you don't.

Long answer: 0x7ffffff is the largest positive value that will fit into a Java int (32 bits).  32 bits is alse the most memory space your program could possibly have on most current platforms.  So even if your array were allocated, you would have no room for your program.

As suggested above, when you start talking about data storage or access of this size, you *don't* want to use an array.  There are other alternatives that are better-suited to large datasets (databases) or sparse data sets (hash tables).

Look up the Java API for HashTable (and various other Sets and Collections) and see if one of those might be more suitable to your purposes.

Accepted Solution

Moondancer earned 0 total points
ID: 6878649
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
Thank you everyone.
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.

Expert Comment

ID: 6888489
I refunded your 20 points to you awarded me in error.  I asked that I not be granted points, since I am a Moderator here and did not provide you any technical guidance; others did.

Please post a new question in this topic area for the expert or experts who did help you here to award them points for their efforts/help given.  This is done as follows:

New question entitled __Points for expertname__ in the comment field, paste the URL to this question.  The expert(s) will then comment or propose an answer for you to accept and grade to complete.

If you have questions in this regard, let me know.

Moondancer - EE Moderator

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

721 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