ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Jaspersoft Native memory allocation (mmap) failed to map

book

Article ID: 239935

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

You followed the steps in this KB to remediate the vulnerability

 https://knowledge.broadcom.com/external/article?articleId=238263 to install a new version of Tomcat.

However, after following  the steps detailed below, you receive a memory error as shown:

*********************************************************************************************************************************

Steps we took (per https://knowledge.broadcom.com/external/article?articleId=238263)

  1. Download the apache-tomcat-9.0.62.tar_1649767997732.gz file
  2. Transfer to linux server to this location:  /opt/cappm/ppm/tomcat/
  3. gunzip apache-tomcat-9.0.62.tar_1649767997732.gz
  4. tar -xvf apache-tomcat-9.0.62.tar_1649767997732

   (resulting content in /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62)

  1. cp -R /opt/cappm/ppm/tomcat/apache-tomcat-8.5.43/webapps/reportservice /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/webapps
  2. cp -R /opt/cappm/ppm/tomcat/apache-tomcat-8.5.43/.jaspersoft /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62
  3. In /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/.jaspersoft/default_master.properties updated per instruction
  4. Downloaded ojdbc8-19.8.0.0.jar from https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8/19.8.0.0
  5. copied to /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/lib
  6. chown cappm:cappm ojdbc8-19.8.0.0.jar
  7. cp /opt/cappm/ppm/tomcat/apache-tomcat-8.5.43/conf/server.xml /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/conf
  8. cp /opt/cappm/ppm/tomcat/apache-tomcat-8.5.43/bin/setenv.sh /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/bin
  9. Verified setenv.sh javaops parameters
  10. chmod all files in new tomcat directory:

    cd /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62

    chmod -R +xr *

  1. Update account's .bash_profile to reference new tomcat directory:

    cd /home/cappm

    more .bash_profile

    change CATALINA_HOME to use new directory

 

 

./startup.sh

Log file shows this:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000004d4cc0000, 12535988224, 0) failed; error='Can

not allocate memory' (errno=12)

#

# There is insufficient memory for the Java Runtime Environment to continue.

# Native memory allocation (mmap) failed to map 12535988224 bytes for committing reserved memory.

# An error report file with more information is saved as:

# /opt/cappm/ppm/tomcat/apache-tomcat-9.0.62/bin/hs_err_pid20862.log

 ********************************************************************************************************

 

Environment

Release : 15.9.3

Component : PPMJSP

Resolution

 Tomcat is trying to allocate 12 gb on startup. However, there is not enough contiguous memory on the server for java.

First thing we can check is id there are any zombie java processes running on the server.

ps -aux | grep java

Kill off any PID of any jaspersoft related java process.

Then try the /opt/jaspertomcat/bin/startup.sh again.

If it still gets the same error, we can lower the memory for startup in this file.

/opt/jaspertomcat/bin/setenv.sh

and look for:

export JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx2048m -XX:MetaspaceSize=32m"

 

Change the part after "-Xmx" to something smaller, like 8 gb.  For example:

export JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx8g -XX:MetaspaceSize=32m"