Question

I'm trying to generate Call graph using Spark (in Soot -Eclipse framework) for java code. I started with HelloWorld. Even for this small example it looks like the system memory isn't enough.

Soot has run out of the memory allocated to it by the Java VM.
To allocate more memory to Soot, use the -Xmx switch to Java.
For example (for 400MB): java -Xmx400m soot.Main .

My machine is Windows based 4GB Core I-5. The eclipse process running is javaw.exe. Is this out-of-memory behavior expected even for Helloworld using soot? I'm new to running profiling for java and im not sure if the library classes are adding a huge overhead.

OR maybe the right question is - how do i use the -Xmx switch for running Soot with more memory in Eclipse on Windows -anyone done this?

The command in Eclipse is below. Im using some simplification options in Spark Analysis.

soot.Main     --w --d C:\Users\nbalaji\workspace\HelloWorld\sootOutput 
--process-path C:\Users\nbalaji\workspace/HelloWorld/src;    
--cp /C:/Users/nbalaji/workspace/HelloWorld/bin/, < bunch of Java/jre7 files >

Edit: This is resolved now. From the Soot survival guide: When setting up a run configuration you should add the following parameters to the JVM -Xmx512m -Xss256m to increase the VM memory.

Was it helpful?

Solution

Soot using much memory is not a bug. Your Hello-World program transitively calls thousands of methods, all of which are analyzed.

As the exception message suggests, you should use:

java -Xmx400m soot.Main ...

This is a JVM option, not a Soot option.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top