mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 20:59:07 -05:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/2998
Author: @Josh-Voyles
Created: 5/4/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @oschwartz10612
Base:
dev← Head:mem-fix-2📝 Commits (5)
d6abe83fix: memory improvements2c85bcdfix(db): deterministically finalize prepared statements after execution0655ba9fix: revert investigative changes, keep root cause fixes only9bd3307cleaned comments - more concise2154811removed possible introduced HA Redis bug; improved comment📊 Changes
3 files changed (+94 additions, -7 deletions)
View changed files
📝
server/db/sqlite/driver.ts(+62 -1)📝
server/private/routers/ws/ws.ts(+9 -3)📝
server/routers/ws/ws.ts(+23 -3)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Preface
I'm a cloud engineer with experience in Python and Bash; I do not have much experience with JS/TS. This fix relied heavily on OpenCode and Claude Opus 4.6 and several iterations testing 'confident' bug fixes. However, this implementation has been very solid and performant, seems logical, and is relatively minimal. No code or comments are left over from previous attempts to fix the problem.
Summary
Context
Drizzle-orm creates a new native sqlite3_stmt (8-32KB) per query and never calls finalize(). Under the increased DB load introduced in v1.13.0 (OLM per-user-per-org, ping accumulators, bandwidth tracking), statement creation outpaced GC, causing steady off-heap memory growth until OOM. PostgreSQL was unaffected because prepared statements live server-side and connection pool recycling cleans them up.
Changes
Verification
Tested under normal usage, 7 day requests retention, and Uptime Kuma checks for 48 hours. Pangolin container memory usually hovers around 335MB. I do not have any memory limits set in my compose file. No memory issues or pegged CPU causing a zombie instance.
How to test?
Build docker container community version using sqlite database.
1GB 2vCPU AWS t3a.micro instance
Fixes #2120
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.