Absent Member.
Absent Member.
5093 views

When I tried to run sourceanalyzer in MAC OS Sierra version 10.12.3, it gave the invalid maximum heap size error. The default max heap size in the JVM was about 500M. Run sourceanalyzer. Invalid maximum heap size: -Xmx0. [error]: Unable to find a sui

When I tried to run sourceanalyzer in MAC OS Sierra version 10.12.3, it gave the invalid maximum heap size error. The default max heap size in the JVM was about 500M.

-----------------------------------------------------------------------------------------------------

Run sourceanalyzer.  

Invalid maximum heap size: -Xmx0.

[error]: Unable to find a suitable Java VM. The following were attempted:      > /Applications/HPE_Security/Fortify_SCA_and_Apps_16.20/jre/lib/server/libjvm.dylib: Invalid Java arguments.   

Please verify the integrity of your HPE Security Fortify installation, or set the JAVA_HOME environment variable to a pre-existing Java installation that meets minimum requirements given in the user guide.  

--------------------------------------------------------------------------------------------------------------------------

I ran the following command to verify that the default max heap size in JVM was not zero.

java -XX:+PrintFlagsFinal -version | grep -iE 'heapsize|permsize|threadstacksize'

     intx CompilerThreadStackSize                   = 0                                   {pd product}

    uintx ErgoHeapSizeLimit                         = 0                                   {product}

    uintx HeapSizePerGCThread                       = 87241520                            {product}

    uintx InitialHeapSize                          := 33554432                            {product}

    uintx LargePageHeapSizeThreshold                = 134217728                           {product}

    uintx MaxHeapSize                              := 536870912                           {product}

     intx ThreadStackSize                           = 1024                                {pd product}

     intx VMThreadStackSize                         = 1024                                {pd product}

java version "1.8.0_121"

Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

What could be the problem?       

Labels (1)
0 Likes
5 Replies
Commander
Commander

Sunny,

You should pass on the command line the max heap size:

-Xmx4G or around 2/3 of physical memory

0 Likes
Absent Member.
Absent Member.

If I passed the max heap size in the command line, it no longer complained about the invalid max heap size error.

It worked.

Is there a configuration variable that I can set the default max heap size so that I don't need to pass this parameter every time?

0 Likes
Commander Commander
Commander

You can set an environmental variable SCA_VM_OPTS to the value you want -Xmx4G (or what ever memory size you want).

0 Likes
Absent Member.
Absent Member.

Thank for your quick response.

I come to another problem. I use clang++ as the complier for c/c++ code.

sourceanalyzer -b test01 clang++ <list of parameters>

<BuildSession xmlns="xmlns://www.fortifysoftware.com/schema/build-session"><FormatVersion schema="1.3" engine="16.20.0157"/><TimeStamp created="2017-03-29T08:59:05.535-07:00" lastModified="2017-03-29T08:59:05.535-07:00"/>

:

:

ClassPath/><JavaBuildDirectories/><LibDirs/><CTypeSizeModel>LP64</CTypeSizeModel><ErrorMessages><Entry id="1217" string="An error occurred while running translator"/>

[warning]: An error occurred while running translator

Questions:

1.) Does sourceanalyzer support clang++ compiler?

2.) What could be the problem?

0 Likes
Absent Member.
Absent Member.

This is no longer an issue. We use scons scripts to build the projects and setup a g++ symlink in the build folder to use sourceanayzer in another folder but scons doesn't use the system $PATH. It is still using the default /usr/bin/g++ so sourceananlyzer is not called. The problem has been resolved.

I find sourceanalyzer does support clang++ even thought the user guide doesn't mention it.

By the way I am using MAC OS, which property file contains the environmental variable SCA_VM_OPTS?

Thanks for your help.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.