4

In our .NET DD4T webapplication (using the 2013 SP1 provider) we sometimes get the following error:

InnerException: Stacktrace: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown Source)
    at java.io.ByteArrayOutputStream.grow(Unknown Source)
    at java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source)
    at java.io.ByteArrayOutputStream.write(Unknown Source)
    at org.hibernate.type.descriptor.java.DataHelper.extractBytes(DataHelper.java:171)
    at org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor.wrap(PrimitiveByteArrayTypeDescriptor.java:124)
    at org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor.wrap(PrimitiveByteArrayTypeDescriptor.java:41)
    at org.hibernate.type.descriptor.sql.BlobTypeDescriptor$5.doExtract(BlobTypeDescriptor.java:118)
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:65)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:269)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265)
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:238)
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:357)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2695)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1552)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1484)
    at org.hibernate.loader.Loader.getRow(Loader.java:1384)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:640)
    at org.hibernate.loader.Loader.doQuery(Loader.java:856)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
    at org.hibernate.loader.Loader.doList(Loader.java:2463)
    at org.hibernate.loader.Loader.doList(Loader.java:2449)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
    at org.hibernate.loader.Loader.list(Loader.java:2274)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252)
    at com.tridion.storage.persistence.JPABaseDAO.executeQueryListResult(JPABaseDAO.java:281)
    at com.tridion.storage.persistence.JPABaseDAO.executeQueryListResult(JPABaseDAO.java:249)

Allocating more size to the Java heap space is not the first solution we should look at. But the webapplication is getting bigger and bigger and we think in this case we have to increase the Java heap space.

I did some research and found out that you have to assign it to a specific jar (https://stackoverflow.com/questions/25060045/jvm-64-is-using-a-maximum-of-2gb-on-windows-server-2012-on-azure).

To which jar should I assign the extra heap space in this case?

6

You can specify the java settings used by your .NET application in two ways : either by making changes in windows registry, or by adding a jvm.xml file with the settings in the bin/config folder of your webapp.

This is explained here : https://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-5163B30C-F33E-4648-A887-A50BA86B573D

The jvm.xml file looks like this

<!--
This file can be used to send application specific JVM arguments.
-->
<VirtualMachine>
    <Options>
        <!--
        Add the Option tag to define specific JVM options.
        The Option tag can define the MaximumHeapSizeInMB (-Xmx), the InitialHeapSizeInMB (-Xms) and other JVM properties(-D).
        -->
        <!-- 
        <Option Name="-Xmx" Value="400m"/>
        <Option Name="-Xms" Value="50m"/>
        -->
        <!--
        <Option Name="-Dfile.encoding" Value="UTF-8"/>
        -->
    </Options>
</VirtualMachine>
  • Hi Harald, thank you for the great answer. Don't know why I missed it in the SDL docs. – Peter van der Lugt Nov 20 '18 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.