We install a system profile every time we make a "major" change, to ensure your dual GPU mac can switch video cards without it being noticeable. Some apps also listen to this change and try to update their UI.
Since it sounds like Java is doing something very expensive, I recommend you disable our profile writer, using the prefs on this page ("disableProfile"):
https://justgetflux.com/news/2014/10/28/profile.html
There may be some flickering if your machine switches GPUs but it's preferable to anything taking 10 seconds.