OutOfMemoryError in chemaxon.jchem.db.Exporter

User eb7d5cd1ec

16-06-2008 03:31:58

Hello everybody:


I tried to use chemaxon.jchem.db.Exporterwant to export some data from my database, but have some problem:


my code is :


Exporter exporter = new Exporter();


exporter.setConnectionHandler(ch);


exporter.setTableName("TABLE_A");


exporter.setFieldList("F1 F2 F3 F4 F5 F6 F7");


exporter.setFormat(Exporter.SDFILE);


exporter.setOutputStream(os);


exporter.writeAll();





but throw OutOfMemoryError:





When I writed like this:


exporter.setFieldList("F1 F2 F3 F4 F5 F6");


it works well.





My question is:


How to run exporter successfully with more than 6 fields?





PS: my JChem version is 5.0.1,and I'm using oracle database.

ChemAxon 9c0afc9aaf

16-06-2008 13:01:24

Hi,





Exporter uses a fetch size of 1000 to achieve optimal export speed.


It is trues, that 1000 x 7 columns requires a bit more memory than for 6 columns, but I suspect your application is already close to the maximum if such a minor thing makes a difference.


How much heap memory do you allow currently for the JVM ?


I guess allowing a bit more should do the trick.


Please see our FAQ for more information:


http://www.chemaxon.com/jchem/FAQ.html#outofmemory





Best regards,





Szilard

User eb7d5cd1ec

17-06-2008 02:38:19

Hi,





Thank you for your answer.


I had set -Xmx512m for the JVM, should I set it to 700m or more?





With 512m JVM, I had tried to add conditon, got 3 records


exporter.setConditions(conditon);


it doesn't work well, the same outofmemory error.





Is it have samething to do with the number of the columns?





By the way, For some business reason, my jchem version is 5.0.0, cannot


update to 5.0.1 in soon, and cannot use Exporter.


I had used another way(write line by line) to export the SDFile.





Best regards,


lsqsusu

ChemAxon 9c0afc9aaf

17-06-2008 08:27:45

Quote:
I had set -Xmx512m for the JVM, should I set it to 700m or more?
It depends on what other allocations you have in your program.





It can be interesting how much memory your application needs (the limit where no out of memory happens) without calling Exporter. It could also be interesting to see how this limit changes when exporting with 6 and 7 columns.





Also what kind of data is in the columns, especially in the 7th column ?


(type, average size)





Best regards,





Szilard

User eb7d5cd1ec

18-02-2009 06:49:11

i'm so sorry that i got late to reply.





i have upgraded the jchem to 5.1.4, and there is no problem with Exporter even output 11 fields.