IBM Support

Java Heap Space Error When Running Report with a Chart

Troubleshooting


Problem

Running a chart report that has hundreds or thousands of data points may result in the following error CGSErrorAssert:0:Fatal: Error: Java heap space

Symptom

Error in Cognos Viewer is:

CGSErrorAssert:0:Fatal: Error: Java heap space : null at org.dom4j.DocumentFactory(DocumentFactory.java:178) at org.dom4j.tree.AbstractElement(AbstractElement.java:899) at org.dom4j.io.SAXContentHandler(SAXContentHandler.java:299) at org.apache.xerces.parsers.AbstractSAXParser(null:-1) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl(null:-1) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher(null:-1) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl(null:-1) at org.apache.xerces.parsers.XML11Configuration(null:-1) at org.apache.xerces.parsers.XML11Configuration(null:-1) at org.apache.xerces.parsers.XMLParser(null:-1) at org.apache.xerces.parsers.AbstractSAXParser(null:-1) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser(null:-1) at org.dom4j.io.SAXReader(SAXReader.java:465) at org.dom4j.DocumentHelper(DocumentHelper.java:278) at com.ibm.cgsBus.FrameWork.CGSCanvas(null:-1) at com.ibm.cgsBus.FrameWork.CGSCanvas(null:-1) at com.ibm.cgsBus.CGSRequestHelper(null:-1) at com.ibm.cgsBus.CGSServerNonAsyncRequest(null:-1) at com.ibm.cgsBus.CGSServerNonAsyncRequest(null:-1) at com.ibm.cgsBus.CGSServerNonAsyncRequest(null:-1) at com.ibm.cgsBus.CGSServerNonAsyncRequest(null:-1) at java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java:908) at java.util.concurrent.ThreadPoolExecutor$Worker(ThreadPoolExecutor.java:931) at java.lang.Thread(Thread.java:738) RSV-SRV-0042 Trace back:RSReportService.cpp(766): CGSErrorAssert: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(263): CGSErrorAssert: CCL_RETHROW: RSReportServiceMethod::process(): asynchWait_RequestRSASyncExecutionThread.cpp(828): CGSErrorAssert: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(277): CGSErrorAssert: CCL_CAUGHT: RSASyncExecutionThread::runImpl(): asynchRun_RequestRSASyncExecutionThread.cpp(884): CGSErrorAssert: CCL_RETHROW: RSASyncExecutionThread::processCommand(): asynchRun_RequestExecution/RSRenderExecution.cpp(670): CGSErrorAssert: CCL_RETHROW: RSRenderExecution::executeExecution/RSRenderExecution.cpp(1187): CGSErrorAssert: CCL_RETHROW: RSRenderExecution::processActiveDocumentsFrameWork/CGSCanvas.cpp(629): CGSErrorAssert: CCL_THROW:

Cause

The maximum Java heap is set too low for the Cognos Graphics Service. By default it is set to use a maximum of 1GB of Java heap.

Resolving The Problem

The solution is to increase the Java heap memory used by the graphics service. In all cases the IBM Cognos services on the application tier should be shut down to ensure there are no lingering processes.

For Windows 64-bit environment:

1. Ensure you make a back up of <install>\webapps\p2pd\WEB-INF\services\cgsService.xml

2. Using a text editor edit cgsService.xml

3. Locate the first instance of <!-- JVM arguments -->

4. Change

<child-proc-cmd>Xmx1g</child-proc-cmd>

to

<child-proc-cmd>Xmx4g</child-proc-cmd>

5. Add the following after the above line:

<child-proc-cmd>Xms4g</child-proc-cmd>
<child-proc-cmd>Xmn2g</child-proc-cmd>

This section of the configuration file should now look like the following:

<!-- JVM arguments -->
<child-proc-cmd>-option</child-proc-cmd>
<child-proc-cmd>COG_ROOT=</child-proc-cmd>
<child-proc-cmd>-vmargs</child-proc-cmd>
<child-proc-cmd>Xmx4g</child-proc-cmd>
<child-proc-cmd>Xms4g</child-proc-cmd>
<child-proc-cmd>Xmn2g</child-proc-cmd>

6. Do the same to the second <!- JVM arguments --> section in the configuration file. This time it will look like:

<!-- JVM arguments -->


<child-proc-cmd>-option</child-proc-cmd>
<child-proc-cmd>COG_ROOT=</child-proc-cmd>
<child-proc-cmd>-vmargs</child-proc-cmd>
<child-proc-cmd>Xmx4g</child-proc-cmd>
<child-proc-cmd>Xms4g</child-proc-cmd>
<child-proc-cmd>Xmn2g</child-proc-cmd>


On UNIX/Linux 64-bit

1. Make a back up of cgsServer.sh located in both <install>/bin64 and <install>/bin

2. Modify cgsServer.sh in both places as such:

Replace:

$JAVA_CMD $JAVA_OPTS -Xmx1g $USE_NON_ASYNC -classpath $CLASS_PATH com.ibm.cgsBus.CGSServer

with

$JAVA_CMD $JAVA_OPTS -Xmx4g -Xms4g -Xmn2g -Xcompressedrefs $USE_NON_ASYNC -classpath $CLASS_PATH com.ibm.cgsBus.CGSServer

There isn't a requirement to redeploy the application in WebSphere or other application servers if not using Tomcat (<10.2.2) or Liberty (10.2.2).

You need to ensure you have enough RAM on the application server to ensure that you do not run out of resources.

Important Note:
It is not possible to allocate more then 2 GB to the Cognos Graphics Service via the file cgsService.xml when the Cognos BI installation is 32 bit. The installation has to be 64 bit so that the dispatcher and the report server is running in a 64 bit environment. It is possible to allocate more then 2 GB to the Cognos Graphics Service via the file cgsService.xml.

[{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Report Studio","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.2.1;10.2.1.1;10.2.2","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
15 June 2018

UID

swg21695636