[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about retrieveActiveBody()
Ondrej LHOTAK wrote:
> > This is causing a problem in my application: since I'm using Soot as
> > a library, in order to not leak memory I need to invoke releaseActiveBody()
> > after analyzing each method. However, if I need to analyze that method
> > again later, the second call to retrieveActiveBody() generates a
> > NullPointerException. Instead, I'd rather that Soot re-read the method
> > from the classfile and re-generated the Jimple.
> >
> > Would there be any problem by simply removing the "ms = null" line?
>
> It is there also because of memory issues. Specifically,
> CoffiMethodSource links to the data structures used to store the
> bytecodes of the method in coffi, which can be quite large since there
> is an object for each bytecode, and they have links to their successors
> and predecessors. I don't know that coffi supports throwing away the
> information it has about a method and re-reading it from scratch.
> You'd have to dig into coffi to find out.
Hmmm.. maybe I can acomplish what I want (i.e., freeing most/all Soot
objects) simply by invoking G.reset()?
I don't care if the whole shebang is reset between analyzings...
In fact, that would help me because it would potentially mean the behavior
is no longer dependent on the order in which things are analyzed.
Thanks,
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com