memory limit and managing in Java

Status
Not open for further replies.

Aeren

Newbie level 3
Joined
Aug 30, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
Hi everyone!

I would like to store a big amount of data in String format(most likely in an array or a vector), and i would like to know how much i can store(don't really know about memory stuff in JAVA). In a certain time it's possible, that i would like to store 40.000-50.000 or even 100.000 strings at a time.

I also would like to know, if i add strings toa vector like this:
vector.add(new String("bla-bla-bla"))
and later i empty the vector, will i destruct this String as well? Or will only garbage collecting take care of this?

Thanks!

Aeren

Added after 41 minutes:

To make a more direct question: around how many Strings can i store?
 

Using Collections to store any objects is a good idea.No you dont even need to destroy the vector or any object for that matter. The garbage collector inside the JVM manages entire thing. There is no limit to the size of the string but as the string grows and you add more to the same string that would be resource intesive instead go for collections as you mentioned later. that is a better idea.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…