JChem search out of memory

User 6686efeff7

26-01-2012 17:57:26

I am getting an out of memory error running search  using 5.8.  I have attached a self contained program to demonstrate the problem.

_Program output_


E:\workspaces\main2\t\bin>java  -Xmx256m TestUpdateSearch
log4j:WARN No appenders could be found for logger (chemaxon.jchem.db.RegenerationChecker).
log4j:WARN Please initialize the log4j system properly.

Thu Jan 26 17:46:27 GMT 2012
Search mode: SUBSTRUCTURE
Structure table: TEST_TABLE
Total screened: -1
Unique screened: -1
Hits: 0
Total time: 19947 ms  Screening: 0 ms
Processing threads: 2
Current / peak / maximum searches per minute: 1 / 1 / Unlimited

Exception in thread "main" chemaxon.jchem.db.DatabaseSearchException: ERROR: Table "TEST_TABLE" could not fit into structure cache
 (out of memory).
Please visit http://www.chemaxon.com/jchem/FAQ.html#outofmemory and
http://www.chemaxon.com/jchem/FAQ.html#cacheSize />
        at chemaxon.jchem.db.JChemSearch.loadCache(JChemSearch.java:2647)
        at chemaxon.jchem.db.JChemSearch.search1(JChemSearch.java:2288)
        at chemaxon.jchem.db.JChemSearch.search(JChemSearch.java:2119)
        at chemaxon.jchem.db.JChemSearch.setRunning(JChemSearch.java:1931)
        at chemaxon.jchem.db.JChemSearch.run(JChemSearch.java:1954)
        at TestUpdateSearch.testSearch(TestUpdateSearch.java:100)
        at TestUpdateSearch.main(TestUpdateSearch.java:36)




_Version details_

JChem: 5.8

Database: HSQLDB, version 1.8

Java:1.6.0_30
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode)

Operating system: Windows XP SP3

ChemAxon a3d59b832c

27-01-2012 11:20:54

Hi,


 


Unfortunately, the error message refers to outdated URL-s. Please check these URL-s instead:


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


http://www.chemaxon.com/jchem/doc/admin/Performance.html#cacheSize


 


(We will also fix the error messages in the next JChem version.)


Let me know if you have any more questions.


 


Szabolcs

ChemAxon a3d59b832c

27-01-2012 11:24:04

Hi,


 


One more thing: Instead of HSQLDB, I recommend the more widely used Derby engine, which is also part of the JRE.


We plan to withdraw JChem official support of HSQLDB in the future.


 


Best regards,


Szabolcs

User 6686efeff7

27-01-2012 13:13:48










Szabolcs wrote:

Hi,


 


Unfortunately, the error message refers to outdated URL-s. Please check these URL-s instead:


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


http://www.chemaxon.com/jchem/doc/admin/Performance.html#cacheSize


 


(We will also fix the error messages in the next JChem version.)


Let me know if you have any more questions.


 


Szabolcs



 


I have looked at your FAQ, and asserted the following, about the test program attached to my first comment.

* The program was run with a max heap size of 256MB

* The database had only 4 molecules. Applying the formula in <http://www.chemaxon.com/jchem/doc/admin/Performance.html#cacheSize>; shows that it should only require 342 bytes of memory.

Therefore the submitted program is well within the constraints proposed by your FAQ. Please advice on a work around.

Wiraj

ChemAxon a3d59b832c

27-01-2012 14:05:19

Hi Wiraj,


 


From the exception it is certain that the problem is that the structure cache cannot fit in the memory.


Please note that in addition to the cache, JChem needs some extra work memory for the processing.


Furthermore, JDBC drivers, HSQLDB, and your business logic all adds up to your memory needs.


 


It should also be checked that the memory settings are recognized properly by the JVM.


(Looks OK to me, though.)


 


So the recommendation is again to check with a higher xmx setting, and with Derby instead of HSQLDB, if possible.


 


Thanks,


Szabolcs

User 6686efeff7

27-01-2012 14:45:23










Szabolcs wrote:

Hi Wiraj,


 


From the exception it is certain that the problem is that the structure cache cannot fit in the memory.


Please note that in addition to the cache, JChem needs some extra work memory for the processing.


Furthermore, JDBC drivers, HSQLDB, and your business logic all adds up to your memory needs.


 


It should also be checked that the memory settings are recognized properly by the JVM.


(Looks OK to me, though.)


 


So the recommendation is again to check with a higher xmx setting, and with Derby instead of HSQLDB, if possible.


 


Thanks,


Szabolcs



Getting the same failure after increasing heap to 1GB. However the same set up works against JChem 5.7 with less then 64MB.


 


Thanks,


Wiraj

ChemAxon a9ded07333

01-02-2012 14:12:12

Hi Wiraj,


I could reproduce the error. I'll try to fix it as soon as possible.


Best regards,
Tamás