Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.OutOfMemoryError

 
sarathchandra chandala
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai

I have to insert around 80 lacs of rows in to the table,while inserting suddenly i got this exception ----->Exception in thread "main" java.lang.OutOfMemoryError<--------

i increased the heap size to 1024m, but same problem is coming

is there any alternative to solve this problem or any other solutions
 
Ricky Martaputra
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you should fixed/recheck your algorithm.

For example:
If you want to insert 80 lacs ( I do not get what lacs is ), used some buffer strategy. In case, put you 10 lacs in a List, save, then clear the list ( list.clear() ) to put next 10 lacs. Do it repeatedly until 80 lacs.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would expect 80 crore to overwhelm your memory, but not 80 lakh.
Have you got some sort of recursion which doesn't terminate?
[ April 25, 2008: Message edited by: Campbell Ritchie ]
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, how long is each line?
80 lakh * 100 Bytes is about 800MB so even 80 lakh might overwhelm your resources.
What sort of table are you inserting into? A database? Are you using anything which maintains the lines in memory after you have inserted them? If you are inserting into a database, is there any delay in the database? Can you put a tiny delay between successive lines? Can you split the process so as to insert 1 line at a time?

And lakh (also spelt lac) = 100000
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic