Dear Sir, This error relates to the Garbage Collection (GC) mechanism of JVM, which means that it does not have enough memory available to complete the task. More in particular, it means that the Garbage Collector is spending too much time clearing the heap space from unused objects, but at the same time it does not free more than 2% of the heap space, which is used for the instantiated objects. That's wh the GC reports that it does not have any more space to do its job.
One thing you can do, if you do not have enough RAM on your server, is first shutdown Tomcat (this will lead to some downtime for your server, but it will free up some valuable RAM and after OAI completes you can restart it) and then go to the */dspace/bin/dspace* file of your running dspace instance and edit it with your text editor. Then, in the file search and find the line: *JAVA_OPTS="-Xmx256m -Dfile.encoding=UTF-8"* and *change it *to: *JAVA_OPTS="-Xmx2048m -Xms1024m -Dfile.encoding=UTF-8"* *DO NOT* copy and paste the line, but edit it in place, because you do not want to mess up this file. This will specify that the dspace *TOOL *(which is the file you are running for the OAI) will use *from 1024MB up to 2048MB RAM* for its task and not just *256MB*. However, you *must have more than 2048MB RAM* available on the server (i.e. 3GB), or the script will fail again and it might hang your server. If you have *LESS *than 3GB allocated to the server, then adjust these values accordingly (i.e. Xmx1024m Xms500m, etc). The bottomline is that you do not have enough memory to complete the task and even if your server has 32GB RAM, the dspace tool will only use up to the RAM specified in this file. I hope that I have helped! Best Regards, -Fk On Mon, Mar 22, 2021 at 4:08 PM Panyarak Ngamsritragul <[email protected]> wrote: > > Hi, > > I am using DSpace 6.3+Apache Tomcat Version 8.0.37+javac 11.0.10 > > The instance I am managing has 11,428 records. (kb.psu.ac.th) > > I tried to create indexes for OAI using this command > > /dspace/bin/dspace oai import -c > > It worked until 8900 items and crashed with error messages: > > 8600 items imported so far... > 8700 items imported so far... > 8800 items imported so far... > 8900 items imported so far... > java.lang.OutOfMemoryError: GC overhead limit exceeded > at java.util.Arrays.copyOfRange(Arrays.java:3664) > at java.lang.String.<init>(String.java:207) > at java.lang.StringBuilder.toString(StringBuilder.java:407) > at > org.hibernate.persister.entity.AbstractEntityPersister.selectFragment(AbstractEntityPersister.java:1422) > at > org.hibernate.persister.entity.AbstractEntityPersister.selectFragment(AbstractEntityPersister.java:4434) > at org.hibernate.loader.JoinWalker.selectString(JoinWalker.java:1099) > at > org.hibernate.loader.AbstractEntityJoinWalker.initStatementString(AbstractEntityJoinWalker.java:123) > at > org.hibernate.loader.AbstractEntityJoinWalker.initStatementString(AbstractEntityJoinWalker.java:108) > at > org.hibernate.loader.AbstractEntityJoinWalker.initAll(AbstractEntityJoinWalker.java:90) > at > org.hibernate.loader.AbstractEntityJoinWalker.initAll(AbstractEntityJoinWalker.java:77) > at > org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:123) > at > org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:92) > at > org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:95) > at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1604) > at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374) > at > org.dspace.core.AbstractHibernateDAO.list(AbstractHibernateDAO.java:158) > at > org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl.findByDSoAndAction(ResourcePolicyDAOImpl.java:74) > at > org.dspace.authorize.ResourcePolicyServiceImpl.find(ResourcePolicyServiceImpl.java:103) > at > org.dspace.authorize.AuthorizeServiceImpl.getPoliciesActionFilter(AuthorizeServiceImpl.java:575) > at > org.dspace.authorize.AuthorizeServiceImpl.authorize(AuthorizeServiceImpl.java:301) > at > org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:129) > at > org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:95) > at > org.dspace.authorize.AuthorizeServiceImpl.authorizeActionBoolean(AuthorizeServiceImpl.java:181) > at > org.dspace.authorize.AuthorizeServiceImpl.authorizeActionBoolean(AuthorizeServiceImpl.java:166) > at org.dspace.xoai.app.XOAI.isPublic(XOAI.java:458) > at org.dspace.xoai.app.XOAI.index(XOAI.java:343) > at org.dspace.xoai.app.XOAI.index(XOAI.java:280) > at org.dspace.xoai.app.XOAI.indexAll(XOAI.java:227) > at org.dspace.xoai.app.XOAI.index(XOAI.java:134) > at org.dspace.xoai.app.XOAI.main(XOAI.java:560) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > Could you please help to solve this problem? > > Thanks and best regards, > Panyarak Ngamsritragul > > -- > All messages to this mailing list should adhere to the Code of Conduct: > https://duraspace.org/about/policies/code-of-conduct/ > --- > You received this message because you are subscribed to the Google Groups > "DSpace Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dspace-community/fcc5dfb5-0c01-4665-b490-e915d4662f96n%40googlegroups.com > <https://groups.google.com/d/msgid/dspace-community/fcc5dfb5-0c01-4665-b490-e915d4662f96n%40googlegroups.com?utm_medium=email&utm_source=footer> > . -- All messages to this mailing list should adhere to the Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/ --- You received this message because you are subscribed to the Google Groups "DSpace Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-community/CAHEC7xsFEAeDA02GtNz8SHep4BEz5OvgGc%3Dit4wrCG63r8f1cg%40mail.gmail.com.
