aspose file tools*
The moose likes Java in General and the fly likes OutOfMemoryError at the time of batch run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "OutOfMemoryError at the time of batch run" Watch "OutOfMemoryError at the time of batch run" New topic
Author

OutOfMemoryError at the time of batch run

akshit indra
Greenhorn

Joined: Sep 14, 2011
Posts: 1
I have a batch file which gets transferred by a batch run.Data from batch file are read and then a match is done to insert data into database.
Sample data(from batch file):
12,234,asd,3456,asv,sdas,asdase,sas,awer
..............................................................(96253 lines)
Earlier a class was used to parse first 4 data(ie 12,234,asd,3456)and then a match was made to enter these data into database.
Code has been written in a fashion to read data using stringTokeniser and nextToken().
Now I need to read last data in each line and then I have to do a match through database and proper translation is done and finnaly I have to enter translated data for it.(awer=>translatedkey;and then translatedkey into Databaase)
I used the same coding pattern and read last data (token by token using nextToken()) and it has worked fine in test environment which has only 300 lines.but problem arises when the same batch(class run in production which has big file 96253 lines)
The issue :
Exception in thread "main" java.lang.OutOfMemoryError:
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

Please help me to find the issue and solution too.

NOTE:I thought since data are read token by token; that might have causes the issue. so I tried to read direct last data of each line using
String result =s.substring(s.lastIndexOf(',')+1, s.length());//but it did not work as the other codes have been written in
a manner to give data token by token. so instead of getting awer I get asv

can I use

s.nexttoken();s.nexttoken(); and s.nexttoken(); to read last column


TIA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemoryError at the time of batch run
 
Similar Threads
Netscape 6.2 configure with client jar files
Applet throwing exception when running it through web browser
Running a jar file with SQLite
Problem running an applet
getting ASCII values of characters using java??