[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on invokeGraphs



On Wed, Nov 27, 2002 at 06:11:16PM -0500, Ankush Varma wrote:
> - Calling InvokeGraphTrimmer using PAG gave an invokeGraph with no methods
>   connected to my main method. Funny, but its probably mea culpa, since I
>   suspect I'm not using it properly.
> 
> Let me know if you have any ideas. Do you have a code fragment that trims an
> InvokeGraph using PAG?

The correct way to use Spark to get trim an invoke graph is:
java -Xmx300m soot.Main -a --app --nooutput -p wjtp.Spark disabled:false,trimInvokeGraph:true Hello

Then you retrieve the invoke graph from the Scene with
Scene.v().getActiveInvokeGraph().

> The smallest I could get was 2000+ transitive targets for a class that called
> nothing but System.out.println(int). Over 5000 methods were in the invoke graph
> for just this test file! Any idea how to get fewer nodes in the invokeGraph? I
> suspect that the MethodCallGraph is involved.

When run with the 1.3.1 JDK library, the above gives a graph with 1485
methods for a Hello, World program (compared to 2973 with just CHA).
(For comparison: 
Spark with onFlyCallGraph:true option: 1223
Spark (default options):               1485
VTA:                                   1556
RTA:                                   1919
CHA:                                   2973

In Java, it is difficult to get this much lower. First of all, even a
"trivial" Hello, World program is not at all trivial: using
java -verbose:class Hello
lists 280 classes being loaded with who knows how many methods.

Another difficulty is that class initiliazer methods can be called at
any time the first time a class is used, so they are treated as possible
entry points. Many of these create objects, making large numbers of
methods reachable.

> PS: The SPARK analysis in the new Soot release looks pretty neat! 

I'd be interested in hearing about your experiences with it.

Ondrej