diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2025-07-23 13:53:52 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2025-07-23 13:53:52 +0200 |
commit | ca6d673d59f27382758e1f54e7731b9d658a5730 (patch) | |
tree | 990d080336e14fb3d4a34fa0b13d36499182eeac | |
parent | 154032c2b5a86d39ba8a22a14b53da7fe328f534 (diff) | |
download | jgit-master.tar.gz jgit-master.zip |
to avoid OOM when transferring very large objects. Use a chunk size
of 256kB. In jgit-186 a user reported that uploading objects larger
than 2GB fails with an OOM error.
Bug: jgit-186
Change-Id: I6876f3cbb60b3a08d6d1ff3d6bcd8ac6ee8cd442
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java index 9b3d60812a..802835cadd 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java @@ -246,6 +246,7 @@ public class LfsPrePushHook extends PrePushHook { .getLfsContentConnection(getRepository(), uploadAction, METHOD_PUT); contentServer.setDoOutput(true); + contentServer.setChunkedStreamingMode(256 << 10); try (OutputStream out = contentServer .getOutputStream()) { long size = Files.copy(path, out); |