[BUG] Daemon memory grows into gigabytes: OperationHistory.json stores multi-MB output lines and is fully loaded and kept resident
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start by locating OperationHistoryRecord.MaxOutputLines and OperationHistoryStore.LoadUnlocked(); the issue identifies the oversized output line and full-store load as the memory growth path. Read the existing output-cap tests and trace how records are clamped on load and save. Done means individual lines and total record output are bounded, existing bloated history shrinks on save, and the tests work across languages.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please confirm these before moving forward
- I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
- I have tested that this issue has not been fixed in the latest (beta or stable) release — the current
mainbranch (e857b3f) still hasOperationHistoryRecord.MaxOutputLinescapping the number of output lines, not their size. - I have checked the FAQ section for solutions.
- This issue is about a bug.
UniGetUI Version
2026.3.3 (Windows installer, x64)
Windows version, edition, and architecture
Windows 11, build 10.0.26200, x64
Describe your issue
The UniGetUI daemon (UniGetUI.exe --daemon, autostarted at login, only running the hourly automatic-update cycle) sits at ~3.4 GB working set / ~5.6 GB private bytes and never releases it. Task Manager can show a much smaller number after Windows trims the working set (I observed it dropping to single-digit MB at an hourly maintenance tick), but the commit charge stays — the memory is genuinely held.
Root cause chain (measured on my machine):
- A Chocolatey auto-update of
visualstudio2026buildtoolsfailed 25 consecutive times between 2026-10-28 and 2026-10-29 (one attempt per hourly automatic-update cycle). - In each failure, the PowerShell error output echoed the whole offending payload into a single line:
ERROR: Exception calling "DeserializeObject" with "1" argument(s): "Unterminated string..."
producing 25 lines × ~24.5 MB each. OperationHistoryRecord.MaxOutputLines = 5000limits the line count only, so every one of those 24.5 MB lines is persisted verbatim.OperationHistory.jsongrew to 615 MB: 568 records, where the 25 giant lines account for ~613 MB, and the median size of the remaining 543 records is 133 bytes.- The next recorded operation makes
OperationHistoryStore.LoadUnlocked()doFile.ReadAllText(≈ 1.2 GB as UTF-16) plusJsonSerializer.Deserializeinto a static in-memory cache that lives for the daemon's lifetime → ~3.4 GB working set / ~5.6 GB commit. - Every subsequent operation re-serializes the whole store and rewrites the 615 MB file (O(store) disk write per operation).
Steps to reproduce the issue
Not strictly reproducible on demand, but the chain is: let an automatic update of a package fail in a way whose install script echoes a large payload into one output line (Chocolatey + a PowerShell DeserializeObject exception did this here), let it repeat over several automatic-update cycles, then let UniGetUI record one more operation → the daemon reads the whole store into its static cache and keeps it.
UniGetUI Log
Application logging was not enabled on this machine, so no log files are available. The evidence above comes from the on-disk state (%LOCALAPPDATA%\UniGetUI\Configuration\OperationHistory.json) and from process measurements (Get-Process working set / private bytes), both captured while reproducing the analysis.
Package Managers Logs
Not captured (logging was disabled). The offending captured output is preserved inside the history file itself; the first characters of each giant line are shown in "Describe your issue" above. I did not paste them in full (24.5 MB each).
Relevant information
Proposed fix (I have it ready as a patch and can submit a PR if maintainers agree with the direction):
- Cap a single stored line's characters (keep both ends around a visible truncation marker) and cap the total stored characters per record (keep the tail, where results/errors live) — i.e. byte-level bounds complementing the existing line-count bound.
- Clamp on load and on save, so stores already bloated by older versions shrink back on the next save instead of staying resident in memory and on disk.
- The same patch makes the existing output-cap test assertions language-neutral:
CoreTools.Translatereturns localized markers, soAssert.Contains("omitted", ...)fails on machines running UniGetUI in a non-English language (verified on a zh-language machine, both before and after the change).
- Ngôn ngữ chính
- C#
- Star
- 26.8k
- Fork
- 970
- Merge trung bình
- 17 giờ 39 phút
- Pull request đã merge (30 ngày)
- 132
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Devolutions/UniGetUI
-
enhancement priority: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Devolutions/UniGetUI#5701 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement priority: medium
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
Devolutions/UniGetUI#5692 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: medium
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 43/100
Devolutions/UniGetUI#5685 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-author-answer priority: high winget
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Devolutions/UniGetUI#5683 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Auto Shut Down FeatureĐang mởnew-feature priority: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Devolutions/UniGetUI#5677 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Devolutions/UniGetUI
Issue tương tự
-
Incorrect loop bound in SizeOptIListSelectIterator.ToListCó thể đã có người làm @equmagg đã nhận hôm nay. Đang mởarea-System.Collections untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
dotnet/runtime#137126 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-sdk-for-net#64658 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/aspnetcore#70370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NethermindEth/nethermind#15684 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ai-assistant squad/flyt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Altinn/altinn-studio#21798 ·
Maintainer thường phản hồi trong vòng 1 ngày