"OutOfMemoryError: Java heap space" might occur in SAS® Marketing Automation Integration Utilities 6.7


When you run SAS Marketing Automation Integration Utilities 6.7 (sasmaextract), the following message might occur at the end of the console log: 

Extract completed. 1 object(s) were extracted. 0 error(s) were reported.
[69.884s][error][jvmti] Posting Resource Exhausted event: Java heap space
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.base/java.util.Arrays.copyOf(Arrays.java:3541)
        at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:242)
        at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:611)
        at java.base/java.lang.StringBuffer.append(StringBuffer.java:353)
        at java.base/java.lang.StringBuffer.append(StringBuffer.java:112)
        at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:600)
        at java.base/java.lang.StringBuffer.append(StringBuffer.java:343)
        at com.sas.analytics.crm.auxdataio.util.XMLFormatter.nodeToStringIndented(XMLFormatter.java:299)
        at com.sas.analytics.crm.auxdataio.util.XMLFormatter.nodeToStringIndented(XMLFormatter.java:299)
        at com.sas.analytics.crm.auxdataio.util.XMLFormatter.nodeToStringIndented(XMLFormatter.java:299)
        at com.sas.analytics.crm.auxdataio.util.XMLFormatter.nodeToStringIndented(XMLFormatter.java:299)
        at com.sas.analytics.crm.auxdataio.util.XMLFormatter.format(XMLFormatter.java:125)
        at com.sas.analytics.crm.auxdataio.util.MATransformer.xmlAsFile(MATransformer.java:314)
        at com.sas.analytics.crm.auxdataio.integration.MAIntegrationCommand.run(MAIntegrationCommand.java:264)
        at com.sas.analytics.crm.auxdataio.extract.MAExtract.main(MAExtract.java:150)

Resolution

If this issue occurs, complete the following steps:

1. Review the settings of the sasmaextract.ini file located in <SASHome>/SASMarketingAutomationIntegrationUtilities/6.7.

2. Look for the following Java Arguments:

JavaArgs_1=-Xms50m
JavaArgs_2=-Xmx1024m 

3. Try increasing the settings. (Start with lower numbers and increase.) Here is an example:

JavaArgs_1=-Xms1024m
JavaArgs_2=-Xmx2048m 

In addition, the extract request can attempt to obtain very large amounts of data when there are many campaigns stored in the metadata repository. This operation might require large amounts of memory, causing Out-of-Memory and CORBA Marshaling errors of the middle tier. For this reason, SAS recommends more narrow searches. You can allocate additional memory (if available) to the utilities, if necessary. 

For details, see Using the Extract Utility (Sasmaextract): Overview.