Bug 40764 - AJDT Integration Problem with Large Projects
Summary: AJDT Integration Problem with Large Projects
Status: RESOLVED DUPLICATE of bug 44215
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Sian January CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-25 10:11 EDT by Ronald R. DiFRango CLA
Modified: 2005-08-18 08:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald R. DiFRango CLA 2003-07-25 10:11:46 EDT
I am using the Eclipse 2.1 with aspectj 1.1.2 and the AJDT 1.1.2 plug-in and 
all the classes that are affected by an aspect, I get the following error:

	The type MyClass  is already defined MyClass.java

I do not have any other source files that declare a type called MyClass, nor 
do I have duplicate definitions of MyClass.java.  I can take this same source 
tree and compile it successfully via ANT.  I did not enable incremental 
compilation.
 
For our project, I have over 1400 classes that are involved and need to run 
through the aspectj compiler.  During our ANT process this takes at least 5 
minutes to run.  In order to even get Eclipse (AJDT) to compile this I had to 
increase the memory to 384MB.  I just re-created the project and re-compiled 
my code I get the same error.

For more details you can look at the following email trail in the newsgroups:

http://dev.eclipse.org/mhonarc/lists/aspectj-dev/msg00331.html
Comment 1 Mik Kersten CLA 2003-07-31 08:49:35 EDT
The long-term solution is to integrate more closely into the JDT structure 
model.

For now, we can add an AJDT option that prevented the structure model from 
being built.  This way you could control the memory tradeoff between seeing 
the structure info and minimizing memory use.  You’d still get better compile 
performance, memory use, and integration than from launching an ant task.  
Comment 2 Wes Isberg CLA 2003-08-04 23:58:52 EDT
Perhaps avoid building the structure model if the structure model pane is not
displayed, and suggest that as the workaround.
Comment 3 Mik Kersten CLA 2003-08-07 11:29:43 EDT
I looked at structure models for projects with 1000+ classes and they were 
under 1MB.  So the bytecodes that we keep in memory dominate the structure 
model, so generating the structure model introduces relatively little 
overhead.  

I will keep this bug open as an enhancements so that it prompts us to do more 
profiling of memory usage, etc.  
Comment 4 Mik Kersten CLA 2003-08-07 16:27:48 EDT
Also, we should get the behavior that you asked for once the model is 
integrated with the JDT.  When the Outline view is not around it won't be 
eagerly parsed, so it won't be in memory.  However, I believe that we will 
still need to keep all the crosscutting relationships around from the last 
compile, at least until we have a "fast match" implementation that can do 
everything eagerly.
Comment 5 Ronald R. DiFRango CLA 2003-08-26 23:23:37 EDT
Mik, one additional comment that may help lead to a solution. I am in the 
process of upgrading from version 1.06 to 1.1 and I tried replacing the javac 
compile with ajc.  When I did this my compile time went from 1 minutewith 
javac to 10 minutes with ajc.  The interesting thing about this find leads me 
to believe that there is something more fundamentally going wrong when you 
deal with large projects.  By the way our project is now up over 1500+ classes 
making the problem even worse.
Comment 6 Andrew Clement CLA 2003-08-27 08:42:41 EDT
Although Mik comments that the structure model is not particularly large, for 
much of the model we create Eclipse markers (for gutter annotations) and they 
will also be taking up space.

just a thought.
Comment 7 Mik Kersten CLA 2004-07-27 18:59:14 EDT
Andy: regarding your comment #6, it occurrs to me that our use of markers can 
be a problem on large projects.  Consider the fact that the JDT doesn't use 
Marker, but a much slimmer ConcreteMarker for problems list items.

Markers aren't our model, the ASM is, so why don't we just generate markers 
eagerly for the current file, and discard them once the current file is no 
longer selected?  Note that this would have to happen whenever an editor 
becomes active, not just when it's opened (so it might use an IPageListener or 
an ISelectionListener). 
Comment 8 Sian Whiting CLA 2004-07-30 04:49:56 EDT
Note that markers are only created when an editor is opened or given focus or
given a new file as input, or on a rebuild (for the current editor only).  For
this reason and following some investigations I felt that markers were unlikely
to be causing any serious memory problems, however I have submitted a patch that
will be included in 1.1.12, which deletes markers on closing of an editor window
or when an editor is given a new file as input.  
Comment 9 Sian January CLA 2004-11-23 12:18:35 EST
Marker model changed - see bug 78378:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=78378#c3
Comment 10 Matt Chapman CLA 2005-08-18 08:36:09 EDT
The AJDT issues in this area have been addressed. The biggest memory issue is
currently in the compiler, which is covered under bug 44215.


*** This bug has been marked as a duplicate of 44215 ***