Leaking Gitlab::Git::Repository
When I was looking into potential memory leaks in GitLab I noticed that when I force GC in ruby (I saw that in Unicorn and as well in Sidekiq) there's open handle to Git repository (checked that in /proc/unicorn-or-sidekiq-pid/fd). I looked into allocated objects and noticed that there are Gitlab::Git::Repository references. However, I weren't able to find where this references are stored. I also didn't notice any pattern that is required to reproduce this leak. I was able to spot it a few times.
Maybe you have any idea what can be holding the reference?
Jacob
Could be. A
Project
stores its companion repository in an instance variable. AndRepository.new
stores a Gitlab::Git instance in an instance variable.
Dmitriy
Could be. A Project stores its companion repository in an instance variable. And Repository.new stores a Gitlab::Git instance in an instance variable.
jacobvosmaer you are right. Is it a problem?
Jacob
dzaporozhets I don't know. :)
kamil wrote that he was surprised to find repo references during GitLab Ruby GC, I don't know the context.