aspose file tools
The moose likes Java in General and the fly likes File Read Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "File Read" Watch "File Read" New topic
Author

File Read

debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi all,
i am using the following code to read from a file and put the content into a arraylist

the file "arts.txt" is about 70mb consisting of 760,985 lines. and i am having exception like:

i am using -Xmx750m. Is there any way i can read the file and store the content of the file in a list?

any help would be great.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 471
What are you doing in that Arts class?
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi Somnath,
class Arts consists of
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

If you're storing 70MB worth of Strings in memory you probably need to increase the memory available to the JVM using the -Xmx JVM flag.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: File Read
 
Similar Threads
Replace Text
read content of text file which is in jar
ArrayList in jsp using JSTL and springs
Java interprocess communication
ArrayList to file