lazygit
lazygit copied to clipboard
Memory climbed to 9.6GB while laptop closed
Describe the bug My memory usage climbed to 9GB while my laptop was closed. See screenshot. This issue has never occurred before, but I am not a user very often.
To Reproduce Precise steps unknown.
- I started lazygit as normal and performed some amend & reword message commands.
- I closed my laptop's lid and left the range of WiFi. The battery was high enough such that the OS maintained state.
- I reopened my laptop with lazygit at 9.6GB, slowing my entire system down.
Expected behavior lazygit usually operates at around 20MB idle, around 500X less memory than what was being used just now.
Screenshots

I do not know the difference between the two chosen processes, but the 9.6GB process closed and went away as soon as I pressed q in the terminal. The application was still responsive, it seems.
Version info:
commit=d1a8b05401ccda1e52215203139a252eb3be3b79, build date=2022-11-14T09:22:31Z, build source=binaryRelease, version=0.36.0, os=windows, arch=amd64, git version=2.35.1.windows.2
git version 2.35.1.windows.2
Additional context
- I was using lazygit in combination with Webstorm, working on this repository.
- I was running lazygit inside Windows Terminal on Windows 11, launched from Powershell 7.2.9.
- I work on a Lenovo X1 Carbon Gen 6, with 16GB of RAM.
The only idea I have is that lazygit was somehow making network requests (git fetch) in the background, and they were failing continuously or not being made properly. I left the area I was in, thus disconnecting from WiFi. My laptop should not reconnect to WiFi until it is opened, I would believe.
I know this isn't a great bug report, no logs afaik to go off, but I'm curious if you've had any similar reports.
Could you post your config.yml?
lazygit does auto fetching by default so it might be because of that.
While I have since switched to Pop! OS on my laptop, I have access to the original SSD, and the config.yml I found contains nothing. 0 bytes. Last modified December 12th, 2022 (long before I made the report).
Well then it could be that the autofetching went wild.
Has it happenned again after that one time?
I haven't used lazygit a whole lot since, but no.
I tried lazygit today, I left it in an open terminal and went to have dinner. An hour later I came back and the process was exhibiting high CPU usage and memory consumption.
OS: Windows 10 Version 10.0.19045 Build 19045 Terminal used: Windows Terminal Version: 1.16.10261.0
My config.yml:
git:
paging:
colorArg: always
pager: delta --dark --paging=never

Is that the current master? Is the repo a public one?
Could you also please post the logs?
Apologies for leaving out those pertinent details @mark2185
lazygit -v
commit=16802a048e0425182f08cf0e9a2bc31480e9a55d, build date=2023-02-01T11:02:43Z, build source=binaryRelease, version=0.37.0, os=windows, arch=amd64, git version=2.38.1.windows.1
This was on a local repo for a very small personal project (4 files totaling 32k in size), not public, with a total of 17 commits.
I will use the --debug and --log options next time and provide them if this occurs again.
I managed to capture logs this time. I started lazygit and did not issue any commands, it just sat in the background. About 50 minutes later my CPU usage spiked and I captured the log. I exited lazygit with the q key and the process ended normally.

OS: Windows 10 Version 10.0.19045 Build 19045
Terminal used: Windows Terminal Version: 1.16.10261.0
lazygit -v
commit=16802a048e0425182f08cf0e9a2bc31480e9a55d, build date=2023-02-01T11:02:43Z, build source=binaryRelease, version=0.37.0, os=windows, arch=amd64, git version=2.38.1.windows.1
My config:
git:
paging:
colorArg: always
pager: delta --dark --paging=never
I have now cleared my config file and will keep monitoring.
I just wanted to provide a quick update on this issue.
After my last comment in April, I upgraded to version 0.39.4 in July, and have been using and monitoring lazygit. I have not been able to reproduce this problem again.
I even re-enabled auto-fetch after a few weeks of testing, and am happily leaving lazygit running in the background without any memory usage spikes.
Leaking again in v0.42 version. My lazygit got up to 9GB RAM usage.
The latest version that doesn't have this is 0.39.4