Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] git hooks for [e|j]git

On 17 Oct 2014, at 11:46, Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:

I think it's ok to start with this simplest possible solution.

AFAIK on some platforms spawning another process from Java copies the JVM's heap which
may cause problems on large jgit based server instances e.g. Gerrit which typically run with
a pretty large heap (we use 48GB at the moment). Hence we should have a way to disable
execution of the hooks in jgit.

Integrating the pre-commit hook with the staging view could be challenging since it's not
opened explicitly triggered by a user action. So it's not clear when to trigger this hook.

The implementation for the forking process on Unix (JDK7) is described here:

(Runtime->ProcessBuilder->ProcessBuilderImpl->UNIXProcess in case you wanted to follow the threads down)

It looks like it uses vfork for Linux which avoids the problems of duplicating the virtual memory size. Note that on non-Linux platforms, it uses the fork which may duplicate the virtual memory allocations but not duplicate the memory itself (unless it is actively called). So I’m not sure that the stackoverflow answer is relevant, since that assumes it’s using fork/exec.

On Windows it uses CreateProcessW:


Back to the top