java.io.IOException: error=12, Cannot allocate memory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When trying to add a Git repository to Fisheye the following memory related error is encountered:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 com.atlassian.utils.process.ProcessException: java.io.IOException: Cannot run program "git" (in directory "/home/ubuntu/crucible/var/cache/XXXXX/clone"): java.io.IOException: error=12, Cannot allocate memory com.cenqua.fisheye.rep.RepositoryClientException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: at com.atlassian.fisheye.dvcs.DvcsScanner.processRevisions(DvcsScanner.java:298) at com.atlassian.fisheye.git.GitScanner.processRevisions(GitScanner.java:256) at com.cenqua.fisheye.rep.BaseRepositoryScanner.slurpRepository(BaseRepositoryScanner.java:258) at com.cenqua.fisheye.rep.BaseRepositoryScanner.doSlurpTransaction(BaseRepositoryScanner.java:225) at com.cenqua.fisheye.rep.BaseRepositoryScanner.ping(BaseRepositoryScanner.java:184) at com.cenqua.fisheye.rep.BaseRepositoryEngine.doSlurp(BaseRepositoryEngine.java:92) at com.cenqua.fisheye.rep.RepositoryEngine.slurp(RepositoryEngine.java:381) at com.cenqua.fisheye.rep.ping.OneOffPingRequest.doRequest(OneOffPingRequest.java:28) at com.cenqua.fisheye.rep.ping.PingRequest.process(PingRequest.java:67) at com.cenqua.fisheye.rep.RepositoryHandle.processPingRequests(RepositoryHandle.java:138) at com.cenqua.fisheye.rep.RepositoryHandle.queuePingRequest(RepositoryHandle.java:128) at com.cenqua.fisheye.rep.ping.PingRequest.run(PingRequest.java:33) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Caused by: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:214) at com.atlassian.fisheye.git.GitScanner.processChanges(GitScanner.java:1004) at com.atlassian.fisheye.git.GitScanner.slurpCommits(GitScanner.java:977) at com.atlassian.fisheye.dvcs.DvcsScanner.processBranch(DvcsScanner.java:414) at com.atlassian.fisheye.dvcs.DvcsScanner.processRevisions(DvcsScanner.java:236) ... 14 more Caused by: com.atlassian.utils.process.ProcessException: While executing: "git whatchanged --always --reverse --date-order -m --no-abbrev --no-renames 22a291b2f78c0e1d69cb1b23b53896d2a4cb174e --pretty=format:C:%H%nP:%P%nA:%aN%nE:%aE%nR:%cN%nF:%cE%nD:%at%nS:%s%nB:%b%n@@fe_body_end@@ " at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:262) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:254) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:212) ... 18 more Caused by: com.atlassian.utils.process.ProcessException: com.atlassian.fisheye.dvcs.handler.DvcsProcessRuntimeException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: at com.atlassian.utils.process.ExternalProcessImpl$4.doTask(ExternalProcessImpl.java:273) at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:25) ... 3 more Caused by: com.atlassian.fisheye.dvcs.handler.DvcsProcessRuntimeException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: at com.atlassian.fisheye.git.GitScanner$9.processCommit(GitScanner.java:1083) at com.atlassian.fisheye.git.client.GitChangeParser.handleCommit(GitChangeParser.java:217) at com.atlassian.fisheye.git.client.GitChangeParser.scanPaths(GitChangeParser.java:157) at com.atlassian.fisheye.git.client.GitChangeParser.processLine(GitChangeParser.java:61) at com.atlassian.utils.process.LineOutputHandler.process(LineOutputHandler.java:49) at com.atlassian.utils.process.LineOutputHandler.process(LineOutputHandler.java:36) at com.atlassian.utils.process.PluggableProcessHandler.processOutput(PluggableProcessHandler.java:34) at com.atlassian.utils.process.ExternalProcessImpl$4.doTask(ExternalProcessImpl.java:270) ... 4 more Caused by: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:214) at com.atlassian.fisheye.git.GitScanner.getDiffInfo(GitScanner.java:1020) at com.atlassian.fisheye.git.GitScanner.processGitCommit(GitScanner.java:572) at com.atlassian.fisheye.git.GitScanner$9.processCommit(GitScanner.java:1081) ... 11 more Caused by: com.atlassian.utils.process.ProcessException: While executing: "git whatchanged --always --no-renames --no-abbrev --full-index -U0 --pretty=format: 0180dbf3913c63b503973c7c3841c43f2b37b07a " at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:262) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:254) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:212) ... 14 more Caused by: com.atlassian.utils.process.ProcessException: java.io.IOException: Cannot run program "git" (in directory "/home/ubuntu/crucible/var/cache/XXXXX/clone"): java.io.IOException: error=12, Cannot allocate memory at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:241) at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:350) at com.atlassian.fisheye.dvcs.client.DvcsContext.executeCommand(DvcsContext.java:259) ... 16 more Caused by: java.io.IOException: Cannot run program "git" (in directory "/home/ubuntu/crucible/var/cache/XXXXX/clone"): java.io.IOException: error=12, Cannot allocate memory at java.lang.ProcessBuilder.start(ProcessBuilder.java:475) at java.lang.Runtime.exec(Runtime.java:610) at com.atlassian.utils.process.ExternalProcessImpl.createProcess(ExternalProcessImpl.java:225) at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:238) ... 18 more Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory at java.lang.UNIXProcess.<init>(UNIXProcess.java:164) at java.lang.ProcessImpl.start(ProcessImpl.java:81) at java.lang.ProcessBuilder.start(ProcessBuilder.java:468) ... 21 more 2012-05-25 07:29:52,941 DEBUG [InitialPinger1 XXXXX] fisheye.app RepositoryStatus-setEngineError - Engine Error Set [XXXXX]: Repository index failed due to error com.cenqua.fisheye.rep.RepositoryClientException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: com.atlassian.utils.process.ProcessException: While executing: "git whatchanged --always --reverse --date-order -m --no-abbrev --no-renames 22a291b2f78c0e1d69cb1b23b53896d2a4cb174e --pretty=format:C:%H%nP:%P%nA:%aN%nE:%aE%nR:%cN%nF:%cE%nD:%at%nS:%s%nB:%b%n@@fe_body_end@@ " com.atlassian.utils.process.ProcessException: com.atlassian.fisheye.dvcs.handler.DvcsProcessRuntimeException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: com.atlassian.fisheye.dvcs.handler.DvcsProcessRuntimeException: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: com.atlassian.fisheye.dvcs.handler.DvcsProcessException: Error while communicating with VCS: com.atlassian.utils.process.ProcessException: While executing: "git whatchanged --always --no-renames --no-abbrev --full-index -U0 --pretty=format: 0180dbf3913c63b503973c7c3841c43f2b37b07a " com.atlassian.utils.process.ProcessException: java.io.IOException: Cannot run program "git" (in directory "/home/ubuntu/crucible/var/cache/XXXXX/clone"): java.io.IOException: error=12, Cannot allocate memory java.io.IOException: Cannot run program "git" (in directory "/home/ubuntu/crucible/var/cache/XXXXX/clone"): java.io.IOException: error=12, Cannot allocate memory java.io.IOException: java.io.IOException: error=12, Cannot allocate memory

Cause

When Fisheye starts git, it uses the 'fork' system call, which will temporarily allocate the same amount of memory used by the Fisheye JVM to the git process. The git process will never actually use this memory, but the system call will fail if the OS can't provide it.

Resolution

You can try allowing Linux to 'overcommit' memory via the command 'echo 1 > /proc/sys/vm/overcommit_memory', but it may be better to increase the amount of swap space allocated. In general you should reduce your heap size to whatever Fisheye actually needs -- increasing it will only make this problem worse.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.