0

I am running fortify static code scan.

main\Src>sourceanalyzer  -64 -Xmx6500m -b project -scan -f project.fpr

The JDK is 1.8

java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

After 20 hours, I got PermGen OOM error

[error]: Unexpected exception: java.lang.OutOfMemoryError: PermGen space
^Cendering results               99% [====================]

According to a lot of resource, PermGen is obsolete in Java8.

Any Ideas?

eis
  • 51,991
  • 13
  • 150
  • 199

3 Answers3

1

There is also the option to increase PermGen space

Increase permgen space

-XX:MaxPermSize=128m

There is also the option to enable garbage collection on PermGen space

-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled

Nevertheless you should check with HP whether it is actually needed to increase PermGen space, it could also be a bug in the software. PermGen space out of memory errors are often caused by memory leaks.

Community
  • 1
  • 1
Matthias Steinbauer
  • 1,786
  • 11
  • 24
1
  1. Fortify uses it's own JRE (look under [Fortify Install Root]\jre and [Fortify Install Root]\jre64).

  2. If you use -debug-verbose -logfile Project_Scan.txt you can see if there are issues the scanning engine is having with memory pressure anywhere since it dumps memory usage every so often.

  3. Be sure you are using the latest version of Fortify. If your scan is taking 20 hours, it could be that the latest version addresses the speed and memory issues. The latest is 4.20.

  4. To speed up the scan, have you looked at the Parallel Analysis Mode? This was introduced in 4.00 and you can read about it in the User Guide, Appendix B.

  5. I did some heavy memory tuning with the translation cycle at one point and the following worked well. It should also work for the scan cycle. Please note that this was an extreme memory usage case and this is not the best for all Fortify usage.

    -XX:MaxPermSize=256m -XX:NewRatio=4 -XX:SurvivorRatio=8 -XX:+UseCompressedOops 
    -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC 
    -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled 
    -XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68
    
  6. You can / should use JConsole to watch the process.

James Nix
  • 885
  • 1
  • 6
  • 19
-1

I think in Java 8 the PermGen space has been completely replaced with Metaspace. The JVM options

-XX:PermSize and -XX:MaxPermSize 

have been replaced by

-XX:MetaSpaceSize and -XX:MaxMetaspaceSize respectively. 

Try that.

Syam S
  • 8,421
  • 1
  • 26
  • 36