Gradle 3.4 - java compilation : incremental compilation & forking

Hi,

I was reading about enabling incremental compilation for Java in v3.4. While looking into this, I came across the option to fork the compilation into a separate process (it looks like both these features have there for a while). I’m trying to get a sense of when the combination of the two is useful:

  1. Enabling both incremental compilation and forking the compilation : Is enabling forking detrimental to the performance of incremental compilation?
  2. Does the forked process get reused?

If you could shed some light on this, it would be helpful.

I tried out enabling and disabling forking and didn’t really notice any differences.

Forking has no effect on incremental compile. The processes are reused. The benefit of forking is that you can give the main daemon less memory, shortening gc pauses.