Skip to content

Persistent resource consumption due to failure to close JGit objects #61

@Freaky

Description

@Freaky

Investigating a heap dump from a suspiciously bloated backend service found a substantial number of integer arrays owned by live jgit objects.

I suspect this is a result of RJGit failing to close() AutoCloseable JGit objects - to test this hypothesis I've added:

  module RJGit
    class Repo
      def close
        @jrepo.close
      end
    end
  end

And stuffed a call to this in an ensure block. I added a similar change to my variant of RJGit's Commit#stats call to close the DiffFormatter it uses.

After 12 hours the process has grown by about 100MB (post full-GC), which is considerably less than might have been expected prior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions