This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Performance and the fly likes exception while Read very large file > 300 MB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

exception while Read very large file > 300 MB

Ganesh Sugumaran
Greenhorn

Joined: Jul 08, 2008
Posts: 10
Hi
I want to read a file which has size of more than 300 MB.
While i m executing my code, i m getting
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Below is my code

Im getting the exception in the line 2.
Even though i increased the Heap space up to 900 Mb, i m getting this error.
(FYI)
I executed in command prompt like below,
java -Xms128m -Xmx1024m readLargeFile

Kindly give a solution for this. is there any other best way to read large text file ??
I m waiting for your reply..
Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41129
    
  45
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception while Read very large file > 300 MB
 
Similar Threads
exception while Read very large file > 300 MB
JDBC QUERIES
Write and Update CSV files
Download large files in RMI
java.lang.OutOfMemoryException:java heap space problem