• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Out of memory error while writing to a file

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting an out of memory error while writing the contents from a text file to another. The scenario is, the input file will have several columns and the output file consists some of the columns info from i/p file. There are about 1000000 records in the i/p file. When I am trying to write to the o/p file record by record, its throwing an out of memory exception. Can somebody help me out in this.

Regards,
Ram
 
Bartender
Posts: 9559
12
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must be accumulating data somewhere. Are you putting records into some Collection like an ArrayList? Can you show us a small piece of code that exhibits this behavior?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a big file (as it is in your case) u canot read/write it into the existing i/o streams. All you have to do is break it into chunks of bytes and then read/write whatever..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!