Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedReader input file size limit  RSS feed

 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there an upper limit to the size of a file that can be read using BufferedReader.

Thank you
Karthik
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The memory available to the heap.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastian Janisch wrote:The memory available to the heap.

And that would be only if you tried to read the data from the file and store it all in memory. Otherwise, probably there's no limit at all.

I'm not really sure about that, though. If I really wanted to know the answer, I would just create a 3-gigabyte file (for example) and see what happened when I tried to read it with a BufferedReader.
 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, you can play around with the memory available to the JVM by using the -Xmx512M option (512 is the amount of megabytes you want to assign to the JVM)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!