Getting sources for a (bundle) JarPackageFragmentRoot [message #802047] |
Sun, 19 February 2012 05:01  |
Eclipse User |
|
|
|
HI,
I'm struggling with IPackageFragmentRoot API.
For each IPackageFragementRoot in my workspace, I'd like to analyze all IClassFiles and ICompilationUnits. For each, I requested the AST from SharedAstProvider.getAST(ITypeRoot,..) which worked but was slow and consumed all memory over time until eclipse became unresponsive.
Is there a better way to perform this kind "loading all types in a project" that does not fill up Eclipse's memory completely?
Thanks,
Marcel
|
|
|
|
Re: Getting sources for a (bundle) JarPackageFragmentRoot [message #803602 is a reply to message #802047] |
Tue, 21 February 2012 09:58  |
Eclipse User |
|
|
|
On 2/19/2012 3:31 PM, Marcel Bruch wrote:
> I'm struggling with IPackageFragmentRoot API.
>
> For each IPackageFragementRoot in my workspace, I'd like to analyze all
> IClassFiles and ICompilationUnits. For each, I requested the AST from
> SharedAstProvider.getAST(ITypeRoot,..) which worked but was slow and
> consumed all memory over time until eclipse became unresponsive.
>
> Is there a better way to perform this kind "loading all types in a
> project" that does not fill up Eclipse's memory completely?
In JDT/UI we have to create ASTs for a bunch of types for 'Clean-up'
operations, there we use
org.eclipse.jdt.internal.corext.dom.ASTBatchParser to create ASTs in a
batch as opposed to one by one.
Creating ASTs in a batch is definitely better in terms of performance,
but I don't know how much better.
Disclaimer: You may run into out of memory errors in some cases. I know
at least one open bug for this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337514
--
Deepak Azad
http://wiki.eclipse.org/JDT/FAQ
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds