Search code examples
javabashsubgit

SubGit Java Heap Space


While running SubGit I'm finding that the default Heap Size isn't adjustable, as I'm basically running:

subgit install foo.git

With the settings contained therein.

When checking the max heapsize with jmap -heap {pid} I can see 5022Mb allocated - while I have 20Gb allocated to the VM.

Same is true with java -XX:+PrintFlagsFinal -version | grep HeapSize leading me to believe that Subgit is using the default Java Heap value.

As I'm in a VM, I need to adjust this dynamically.

Is there a way to set SubGit heap size directly when launching the application? Or is there a way to update the default Java value?

Cheers


Solution

  • SubGit daemon's settings indeed cat be set in the configuration file by using "javaOptions" configuration options as Petr has mentioned. For example, for 512MB heap:

    [daemon]
    javaOptions = "-noverify -client -Djava.awt.headless=true -Djna.nosys=true -Xmx512m"
    

    To add more memory to SubGit standalone executable (not daemon), edit SubGit launching script and change EXTRA_JVM_ARGUMENTS line, like:

    EXTRA_JVM_ARGUMENTS="-Dsun.io.useCanonCaches=false -Djava.awt.headless=true -Djna.nosys=true -Dsvnkit.http.methods=Digest,Basic,NTLM,Negotiate -Xmx512m"