File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Read

 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 482
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you doing in that Arts class?
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Somnath,
class Arts consists of
 
Rob Spoor
Sheriff
Pie
Posts: 20393
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic