-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
High CPU consumption due to frequently Garbage Collect (GC) #31956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could be be the bleve indexer, see #31565 and try disabling it via |
set |
I set Sometimes I switch to Windows to play games and then switch back to Arch Linux. Because of the different ways Windows and Linux handle the hardware clock (its a normal issue), the system time in Linux is 8 hours ahead(because I'm in UTC+8 timezone), and Linux will update system time as soon as it connect to Internet. I found this issue occurs immediately after system time update. Restart gitea manually could calm Gitea down. As for Gitea's log, I have changed log level to |
You need to change the log mode to |
The log mode had been This issue hasn't occured again after I set
|
https://docs.gitea.com/help/support
|
https://docs.gitea.com/help/support
|
And from your screenshot, I can see the the "free memory" is low. It seems that you are running a lot of services in a host which only has 3.4G memory. Maybe you could try to stop unrelated services or move Gitea to a new host to try. |
In 1.23 , there is a license classifier, which consumes much more memory than 1.22 (100MB more) , so if the memory is low, the GC number could also become very high. |
The origin issue is in 1.22.1 and there's another issue in 1.23.1 which seems that it is caused by the new license detect feature. |
I don't see it similar. All that should be stored with licenseclassifier is is a simple map of repo to license, e.g. a small cached map, and that should consume miniscule amounts of memory. While it is running, increased memory is acceptable, but if there is more in use after it has run, that would indicate unnecessary storage or a memory leak in the module. |
licenseclassifier is used to classify/detect the provided license file belongs to which kind of license, not a All all known sample license files are in: The total size is 6.1M |
DB "cache" is fine too, but I'd advise against loading all license files into memory, that won't scale too well with instances that have millions of repos. Just re-write the DB entry when the repo is being pushed to. |
Maybe I misread. 6MB static sample licenses is fine of course. |
An advantage to putting those license information in a database is they can be updated on the fly but not always wait for another release. |
Some of these discussions are off-topic. Let's focus on the problem:
Update: The "license" memory usage should should have been fixed by Only keep popular licenses #33832 (in the current development branch "main" 1.24) |
We close issues that need feedback from the author if there were no new comments for a month. 🍵 |
The "license" memory usage should should have been fixed by Only keep popular licenses #33832 (in the current development branch "main" 1.24) |
Description
Hi,
Recently I've been troubled by the issue of high CPU consumption of Gitea. The CPU consumption often become very high after running about 10 hours, and restart gitea can temporally solve this problem.
The most suspicious behavior of gitea during high CPU consumption is frequent GC. I have taken a screen record when cpu consumption becomes high.
gitea.mp4
After restarting Gitea, GC seems "calm down".
Here is the log of gitea (Though I can't find any related information.)
Gitea Version
1.22.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.46.0
Operating System
Arch Linux
How are you running Gitea?
I install the latest gitea from Arch Linux repo
and make it a system service by using systemd
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: