Skip to content
Permalink
Browse files

[JENKINS-8365] avoid unbounded memory consumption with a massive change.

  • Loading branch information...
kohsuke committed Jul 12, 2011
1 parent 46a2670 commit 6cfb79042ee8bba28ec1ab219d4b5c99e6e8c649
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/main/java/hudson/plugins/git/GitChangeLogParser.java
@@ -49,8 +49,8 @@ public GitChangeSetList parse(AbstractBuild build, File changelogFile)
lines = new ArrayList<String>();
}

if (lines != null)
lines.add(line);
if (lines != null && lines.size()<THRESHOLD)
lines.add(line); // TODO: if we ignored some lines, tell the user so.
}

if (lines != null) {
@@ -67,5 +67,9 @@ public GitChangeSetList parse(AbstractBuild build, File changelogFile)
private GitChangeSet parseCommit(List<String> lines, boolean authorOrCommitter) {
return new GitChangeSet(lines, authorOrCommitter);
}


/**
* To control the memory overhead of a large change, we ignore beyond certain number of lines.
*/
private static int THRESHOLD = 1000;
}

0 comments on commit 6cfb790

Please sign in to comment.
You can’t perform that action at this time.