
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Sunny,
You should pass on the command line the max heap size:
-Xmx4G or around 2/3 of physical memory

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You can set an environmental variable SCA_VM_OPTS to the value you want -Xmx4G (or what ever memory size you want).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.