Skip to content

slow git blame on files with large history leading to OOM kills #5110

Closed
@akosyakov

Description

@akosyakov

Bug description

Since last 2 weeks I start getting OOM kills while working on https://github.com/gitpod-io/vscode repo. After investigation it turned out that doing some git operations causes git gc/repack which runs for long sometimes and consumes memory. So newly started processes cannot get more memory and gets killed, eventually leading to the workspace eviction. I found several triggers in my settings: (1) i had auto enabled gti fetch, (2) git blame via gitlens, as wells as (3) git push causes git gc from time to time. In particular blaming via GitLens can get unresponsive for minutes. You can see it on the screenshot below:
Screenshot 2021-08-09 at 07 51 46

Don't pay attention to htop saying 33.G/62.8G. It does not know about gcroups. Instead have a look at the status bar, it shows almost 100% utilisation of memory limited by cgroups, which is used to trigger OOM kills. It is computed here: https://github.com/akosyakov/gitpod-monitor/blob/96d342a3abb13e6608dbd48fdf9efbc4c0700b55/src/extension.ts#L37-L39

I suspect a cause for it is the partial cloning.

Steps to reproduce

Install GitLens and use blame on different files in https://github.com/gitpod-io/vscode while running some task terminals. My particular trigger was doing yarn gitpod-min.

Expected behavior

No response

Example repository

No response

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions