Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting java.lang.OutOfMemoryError: Java heap space when using ArrayList.

807591Apr 16 2008 — edited Apr 16 2008
Hi,
I am using ArrayList to hold some datas.
I am using the following code to hold the datas in the ArrayList
List testList = new ArrayList(Collections.nCopies(9999999), "A"));
I am getting exception has "java.lang.OutOfMemoryError: Java heap space "
when the above line is executed.

Can anyone help me on this how to resolve the issue ..?

thx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2008
Added on Apr 16 2008
4 comments
245 views