Bug 472175 - Perform annotation processing in a separate VM
Summary: Perform annotation processing in a separate VM
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-08 09:52 EDT by Stefan Xenos CLA
Modified: 2020-06-16 05:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2015-07-08 09:52:58 EDT
Currently, Eclipse processes annotations by loading the user's annotation processor into its own VM. This enhancement requests that annotations be processed in a separate VM.

Problems with the same-VM approach:

1. On linux, the VM will crash if a memory-mapped jar or class file goes away. Since build artifacts are usually temporary files and may be stored on unreliable network storage. This can cause Eclipse to segfault seemingly randomly when working with an annotation-heavy code base.

2. Some annotation processors leak memory. This is not a big problem for javac, which is a short-running operation and is only used for one build, but Eclipse is a long-running tool which will be used for many builds so leaks have a long time to build up. Eclipse is the very tool our users should be using to fix a leaky annotation processor, so supporting leaky annotation processors should be a supported use-case.

3. Some annotation processors are unstable and can crash. Much like with 2, this should be a supported use-case in the sense that Eclipse should assist with fixing said crashes rather than crashing itself.

4. Annotation processors can load a lot of classes that aren't otherwise needed by the rest of Eclipse. When running in the same VM, these classes have a permanent memory cost. Running a second VM instance would allow this memory to be reclaimed immediately after the build.

Extracted from bug 469537