On 2015-10-05 13:28, Stanislav Baiduzhyi wrote:
On 05/10/15 11:21, Magnus Ihse Bursie wrote:
Since building the OpenJDK is a heavy operation, the build system tries
to make use as of much of the system resources as possible and
reasonable.
However, on most machines except extremely high-end, this means that few
resources are available for other processes. On a developer machine,
building means that other work can get laggy and have poor response
times.
There is a simple remedy for this! Using "nice" to lower the priority
for the build process, so the build will wait for normal UI processes. A
single "nice" when handling the parallel targets in Init.gmk is
sufficient.
A potential problem could be if this affects performance on dedicated
build servers. I have checked this on Oracle's internal build system,
and there were no measurable regressions. This also stands to reason,
since if there would be, the build server would be running other
processes competing with the build. On a correctly setup build server,
this should not be the case. And if such processes existed, it would be
bad anyway.
Bug: https://bugs.openjdk.java.net/browse/JDK-8138864
WebRev:
http://cr.openjdk.java.net/~ihse/JDK-8138864-make-nice-priority/webrev.01
But why not just add some recommendations to the readme file to
building section? For example, on my system I have crazy powerful CPU
but HDD is the bottleneck, so for me the most useful command will be:
ionice -n 7 -c 3 make images
And to achieve absolutely no impact on the system:
nice -n 19 chrt -b 0 ionice -n 7 -c 3 make images
Trimming the build system for optimal performance on a specific piece of
hardware is a story on it's own. We want to provide suitable defaults
that are likely to at least work OK and at least not work really bad on
all systems and for all users.
I think it would be nice to have some collected documentation on how to
tweak build performance, and if we had, your advice would fit right in
there. Unfortunately, the documentation is as always underprioritized. :-(
/Magnus