Bug 28276 - Should not expose "ant class loader" option to user
Summary: Should not expose "ant class loader" option to user
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords: core, ui
Depends on:
Blocks:
 
Reported: 2002-12-13 10:58 EST by Darin Wright CLA
Modified: 2002-12-16 11:38 EST (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 Darin Wright CLA 2002-12-13 10:58:25 EST
Exposing the option to "reuse the Ant classloader for each build", seems 
complex. It exposes an implementation issue, and is a workaround for two things:
(1) Task development (requires a new classloader to see new classes)
(2) Garbage Collection (re-using a classloader leaks memory)

To solve both issues require a new classloader should be used on each run. 
Thus, we should likely drop the option, and just always use a new classloader. 
This means worse time performance, but better stability for the SDK (avoids 
memeory leaks), and task developers to do not need to understand the 
implications of task development.
Comment 1 Darin Swanson CLA 2002-12-13 11:14:31 EST
The speed hit will not just be for a build...this will impact the external 
tools launch configuration dialog (targets tab) and the Ant view.

Task developers should tend to be more advanced users and should understand the 
implications of task development.

We should work with the jakarta ant project to help find and fix the memory 
leaks...even though these will not appear until the next Ant release.

We could get a better idea about how much memory is leaking and every X uses of 
the Ant classloader create a new one to reclaim the memory. 
Comment 2 Erich Gamma CLA 2002-12-13 16:56:16 EST
Having an option that enables a memory leak behaviour isn't an option. Since 
Eclipse will be blamed for being memory hungry and it is unlikely that a new 
Ant release becomes available until we ship 2.1.

In addition writing Ant Tasks is trivial and common and we should not make it 
special in any way in Eclipse.

Finally, the fact that we run Ant inside the Eclipse VM is an implementation 
detail that we should not surface in the UI (which we do once we expose the Ant 
ClassLoader)

Bottom line: I'm on DarinW's side
Comment 3 Jared Burns CLA 2002-12-13 22:20:19 EST
The only issue I have with this is that I seem to recall it having HUGE
performance implications. If I recall correctly, this change improved the
startup time of our AntRunner by something like a factor of 10.
Comment 4 Darin Swanson CLA 2002-12-14 11:36:21 EST
Just to make sure we are all on the same page...that cached classloader has 
been in use since Oct 2 (please see bug 20557).

We just added the ability for the user to not use the cached classloader.

I agree we can never guarantee that Apache Ant will not leak (even if Ant was 
perfect, the user can load a custom task that could leak like a sieve).
I agree we will take a performance hit removing the caching of the classloader 
(bug 20557).

The nice part is I can easily turn off the caching of the classloader ;-)
Comment 5 Erich Gamma CLA 2002-12-16 03:28:41 EST
>it having HUGE performance implications.
The performance improvements are significant only when measured against an 
empty Ant script. Most Ant scripts perform significant tasks and the 
performance gain becomes less signifcant.

>that cached classloader has 
>been in use since Oct 2 (please see bug 20557).
understood and since then we are leaking. The leak is significant I had to 
restart Eclipse when I used Ant extensively.

Finally, if we want to insulate Eclipse from running Ant then using a separate 
class loader for each run is the right thing to do. Given that Ant is 
extensible with plugins there can always be memory leaks caused by a plugged-in 
task.

Suggest to remove this option for M4 given that the focus of this milestone is 
also on footprint.
Comment 6 Darin Swanson CLA 2002-12-16 09:56:17 EST
The ant support always uses a new classloader.
Please verify (DarinW).
Comment 7 Darin Wright CLA 2002-12-16 11:38:50 EST
Verified.