Jay Roy
asked on
limit of arraylist
hi guys
Can anyone tell me what is the max limit of arraylist and hashmap.
I will have incoming streaming data. I will convert the streaming data into object and add into a ArrayList.
What is the overhead if any? and what is the maximum capacity the ArrayList can hold?
Thanks
Can anyone tell me what is the max limit of arraylist and hashmap.
I will have incoming streaming data. I will convert the streaming data into object and add into a ArrayList.
What is the overhead if any? and what is the maximum capacity the ArrayList can hold?
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is no limit, but memory will limit you
Size variable in the arrayList is of type int.
So, it should store max of INT_MAX_VALUE.
But its not a good practice to store that much data in memory.
So, it should store max of INT_MAX_VALUE.
But its not a good practice to store that much data in memory.
>>What is the overhead if any?
You should probably think of persisting the data to some kind of database or filesystem.
You should probably think of persisting the data to some kind of database or filesystem.
Also when it becomes long then advanrtages over arrays, such as say such thinsg as contains() method
bocome slow
bocome slow
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>>You should probably think of persisting the data to some kind of database or filesystem.
ehcahce could be an option i think.
but i need to use ArrayList because of compatibility issues with my front-end. I am using Adobe Flex in the front end and Flex has nice support for java ArrayList.
I thought of using EHcache but i have two issues
Is EHcache similar to ArrayList ? They both store objects in memory ?
Flex is compatible with ArrayList but may not be compatibe with EhCahce.
thanks all for the quick answers.
ehcahce could be an option i think.
but i need to use ArrayList because of compatibility issues with my front-end. I am using Adobe Flex in the front end and Flex has nice support for java ArrayList.
I thought of using EHcache but i have two issues
Is EHcache similar to ArrayList ? They both store objects in memory ?
Flex is compatible with ArrayList but may not be compatibe with EhCahce.
thanks all for the quick answers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The data in the arraylist needs to be shown
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>>Can the front end shows that many elements at a time? UI should have some kind of pagination functionality.
yes thats true. We do have pagination on the UI
thanks.
yes thats true. We do have pagination on the UI
thanks.
When you have pagination, you should read only the max number of elements that can be shown on UI.