Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Here's a quick steps to get your Groovy classes optimised using Soot framework.


When using Groovy, sometime we encounter the OutOfMemoryException because PermGen space ran out. Optimisation of class files could help saving memory usage of JVM.

Soot Framework

Soot Framework is a bytecode optimisation, and manipulation framework, developed at McGill University, for Java. It comes with a vast set of optimisation techniques. We can also develop our own optimisation using the framework provided.

Quick Optimisation

With Soot, you can just run

to obtain a optimised class.


A trivial class is used in this analysis. The class is illustrated in Jimple format, an intermediate representation supported by Soot to see what's done with Soot optimisation.

Here's a command to get a Jimple file:

and the following is a command for applying optimisation:

We've now got two Jimple files, and can use a text editor to compare them. You can get this two files from the attachment below to see their differences.

The result from the optmisation shows that Soot can reduce the file size by 8.5%. This number is expected to be large when we apply the optimisation to the whole program.

  • No labels