Thursday, September 25, 2008

"Memory Limit Failure" during Ounce Scan

I was scanning a large-ish Web application (about 2M LOC) with Ounce 6 OSA when the scanner ran into memory limits. The OSA console showed the following messages

Processing restricted for call graph with root "acme.util.cal_jsp._jspService", process memory limit exceeded during initial pass
Processing restricted for call graph with root "acme.util.cal_jsp.getComboOptions", process memory limit exceeded during initial pass
Processing restricted for call graph with root "acme.util.cal_005fmb_jsp.xxxYYYZZZZaaaa", process memory limit exceeded during initial pass
Processing restricted for call graph with root "acme.util.common_005mmmm_jsp.", process memory limit exceeded during initial pass
Processing restricted: out of memory. 31 percent of roots skipped
Skipping file: list_set.jsp due to error: Memory Limit Failure

After some tweaking and help from Ounce Support, I finally got that scan working. The trick is to

1. launch $OUNCE_HOME/bin/ouncesettings.sh to modify the amount of memory to give the scanner and to get the scanner to swap content from memory to disk
2. in Ounce Settings, make the following changes

ParameterMemory Limits Failure
IPVA Settings > Prototypical Traces1
IPVA Settings > Pruning Size Heuristics40
Java Settings > JavaC initial, max settings2600 (or to the limit of your JVM)
Java Settings > JSP Chunkingoff (unchecked)
Memory Settings > Swapping Levels100
Memory Settings > Max Num of Mem Chips ... 200
Scan Settings > Show Info Findingsoff (unchecked)

3. By the way, don't forget to hit the Save Tab before moving to the next tab.

Hope these settings work for you.

An0n S3c

No comments: