Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Memory Management Using jdt.core.dom

It appears that holding onto handles of ASTNodes (pretty obvious) and
the type bindings (e.g., ITypeBinding, IVariableBinding,
IPackageBinding, and IMethodBinding) (less obvious) causes the AST to
"stay" in memory -- which can lead to memory problems.  Is there some
description of "proper" use of the DOM?

Is there some method of "swizzling" type bindings into some form where
they can be held at a "global" scope without causing the ast to remain
in memory (e.g. for inter-procedure analysis)?  I have been moving them
to String oriented structures, but this seems like a hack and is really
bad for local variables (No "unique name" available, just an address).

Also is there a way to, say, transfer an IMethodBinding to an IMethod?
or an IVariableBinding (that is a field) to an IField?  (Code pointers
would be OK)

Tim Halloran
Carnegie Mellon University

Back to the top