[Soot-list] JavaToJimple : OutOfMemory

Barthelemy Dagenais barthed at hotmail.com
Tue Jan 15 22:01:56 EST 2008


Hi,

I tried to convert a java source file into a jimple file but got an
OutOfMemoryException after ~two minutes (see below).

The java file is from Jython, a program from the DaCapo suite. When I try to
convert the corresponding class file into a jimple file, it takes only one
second. I also tried to convert several source files from Jython, but was unable 
to do so because of this exception. Any thoughts on how to proceed and why I'm 
getting this error?

I'm using soot version 2.2.4 (although -version says it's 2.2.3) and I'm able to 
convert java source files from smaller toy projects into jimple files.

Thanks,
Barthélémy



Here is the command I used to convert the class file PyFunction.class to jimple:

java -Xms512m -Xmx1512m
-cp
"$HOME/installation/soot/jasminclasses-2.2.4.jar:$HOME/installation/soot/polyglotclasses-1.3.4.jar:$HOME/installation/soot/sootclasses-2.2.4.jar:$HOME/installation/soot/java_cup.jar" 

soot.Main
-soot-class-path
"$HOME/installation/j2sdk1.4.2_16/jre/lib/rt.jar:$HOME/workspaces/runtime-PPA/Jython_2.2.1/bin/" 

-output-format jimple
-output-dir "$HOME/temp/ppabench/jythonjimple/" org.python.core.PyFunction

Output (with real path replaced by $HOME):

Soot started on Tue Jan 15 21:47:33 EST 2008
Transforming org.python.core.PyFunction...
Writing to $HOME/temp/ppabench/jythonjimple/org.python.core.PyFunction.jimple
Soot finished on Tue Jan 15 21:47:34 EST 2008
Soot has run for 0 min. 1 sec.


Here is the command I used to convert the source file PyFunction.java:

java -Xms512m -Xmx1512m
-cp
"$HOME/installation/soot/jasminclasses-2.2.4.jar:$HOME/installation/soot/polyglotclasses-1.3.4.jar:$HOME/installation/soot/sootclasses-2.2.4.jar:$HOME/installation/soot/java_cup.jar" 

soot.Main
-soot-class-path
"$HOME/installation/j2sdk1.4.2_16/jre/lib/rt.jar:$HOME/workspaces/runtime-PPA/Jython_2.2.1/src/" 

-src-prec java -output-format jimple
-output-dir "$HOME/temp/ppabench/jythonjimple/" org.python.core.PyFunction

Output:

Soot started on Tue Jan 15 21:49:18 EST 2008
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 ...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at java.util.HashMap.<init>(HashMap.java:209)
         at java.util.HashSet.<init>(HashSet.java:86)
         at polyglot.visit.FlowGraph$Peer.succEdgeKeys(FlowGraph.java:302)
         at polyglot.visit.DataFlow.dataflow(DataFlow.java:602)
         at polyglot.visit.DataFlow.dataflow(DataFlow.java:408)
         at polyglot.visit.DataFlow.enterCall(DataFlow.java:660)
         at 
polyglot.visit.ErrorHandlingVisitor.enterCall(ErrorHandlingVisitor.java:89)
         at polyglot.visit.ErrorHandlingVisitor.enter(ErrorHandlingVisitor.java:171)
         at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:209)
         at polyglot.ext.jl.ast.Node_c.visitChild(Node_c.java:140)
         at polyglot.ext.jl.ast.Node_c.visitList(Node_c.java:197)
         at polyglot.ext.jl.ast.ClassBody_c.visitChildren(ClassBody_c.java:61)
         at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:216)
         at polyglot.ext.jl.ast.Node_c.visitChild(Node_c.java:140)
         at polyglot.ext.jl.ast.ClassDecl_c.visitChildren(ClassDecl_c.java:137)
         at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:216)
         at polyglot.ext.jl.ast.Node_c.visitChild(Node_c.java:140)
         at polyglot.ext.jl.ast.Node_c.visitList(Node_c.java:197)
         at polyglot.ext.jl.ast.SourceFile_c.visitChildren(SourceFile_c.java:108)
         at polyglot.visit.NodeVisitor.visitEdge(NodeVisitor.java:216)
         at polyglot.ext.jl.ast.Node_c.visit(Node_c.java:144)
         at polyglot.frontend.VisitorPass.run(VisitorPass.java:48)
         at 
polyglot.frontend.AbstractExtensionInfo.runPass(AbstractExtensionInfo.java:308)
         at 
polyglot.frontend.AbstractExtensionInfo.runToPass(AbstractExtensionInfo.java:228)
         at 
polyglot.frontend.AbstractExtensionInfo.runAllPasses(AbstractExtensionInfo.java:195)
         at 
polyglot.frontend.AbstractExtensionInfo.runToCompletion(AbstractExtensionInfo.java:110)
         at soot.javaToJimple.JavaToJimple.compile(JavaToJimple.java:105)
         at soot.javaToJimple.InitialResolver.formAst(InitialResolver.java:113)
         at soot.JavaClassSource.resolve(JavaClassSource.java:46)
         at soot.SootResolver.bringToHierarchy(SootResolver.java:148)
         at soot.SootResolver.processResolveWorklist(SootResolver.java:105)
         at soot.SootResolver.resolveClass(SootResolver.java:89)









More information about the Soot-list mailing list