Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LinkedList size 1

Status
Not open for further replies.

epsonic

Programmer
Nov 9, 2004
14
DE
Hi,
I want to store a undefined number of Strings in a LinkedList.
Always After exceeding a specific size a "java.lang.OutOfMemoryError" is trown.
I tought that one of the advantage using LIsts instead of arrays is because you don't have to specify the size.
Thx for any help.
 
You don't have to specify the size, but if you store more objects than the capacity of JVM, it crashes.

Cheers,
Dian
 
... with a java.lang.OutOfMemoryError no less.

Like Dian says, you don't need to specify a size, but then you are operating with the JVM's defaults for these parameters.

Tim
 
Tim, is it possible to adjust those parameters? Or is it a dynamic thing depending on your system?
 
As far I now the default value of JVM heap size is 64MB.
java -Xmx128M should be enough for my app.
Thanx
 
Yeah, like in my original reply above ... -Xms and -Xmx are used to set initial and maximum memory footprints respectively.

Tim
 
Sorry, I missed that part when I read it. Thanks for the info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top