GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(db): disable SQLite mmap to prevent DB size inflating RSS by zhumengzhu · Pull Request #22553 · anomalyco/opencode

Conversation

@zhumengzhu

@zhumengzhu zhumengzhu commented Apr 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Ref #22428 (same fix, that PR is still open — this supersedes it).

Type of change

  • Bug fix

What does this PR do?

Bun enables SQLite memory-mapped I/O by default, mapping the entire DB file
into the process address space. A 1.1 GB database adds ~1.8 GB to RSS
regardless of how much data is actually accessed. One line added to the
existing PRAGMA initialization block in src/storage/db.ts:

db.run("PRAGMA mmap_size = 0")

Same fix as proposed by @jiangliang79 in #22428.

How did you verify your code works?

  • Full test suite passes (1890 pass, pre-existing 1 fail unrelated to this change)
  • Confirmed mmap_size PRAGMA was not previously set in the codebase

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
朱孟柱 @claude
fix(db): disable SQLite mmap to prevent DB file size inflating RSS
8837427
Bun enables SQLite memory-mapped I/O by default, mapping the entire DB
file into the process address space. A 1.1 GB database adds ~1.8 GB to
RSS regardless of how much data is actually accessed.

Add PRAGMA mmap_size = 0 to the existing PRAGMA initialization block.

Ref anomalyco#22428

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Apr 15, 2026
@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Related PR Found:

  • PR fix: disable SQLite mmap to prevent memory growing with DB size #22428: "fix: disable SQLite mmap to prevent memory growing with DB size"
    • fix: disable SQLite mmap to prevent memory growing with DB size #22428

Why it's related: This is the exact PR mentioned in the current PR's description. PR #22553 is explicitly stated to supersede #22428 as it implements the same fix (adding PRAGMA mmap_size = 0 to prevent SQLite memory-mapped I/O from inflating RSS). The current PR is the updated version that should be merged instead of #22428.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 15, 2026
@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zhumengzhu

zhumengzhu commented Apr 15, 2026

Copy link
Copy Markdown
Author

Closing in favor of #22428 which proposes the identical fix with more detailed analysis (macOS ARM64 footprint measurements). Please consider merging that one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zhumengzhu zhumengzhu closed this Apr 15, 2026
@zhumengzhu zhumengzhu mentioned this pull request Apr 15, 2026
fix: disable SQLite mmap to prevent memory growing with DB size #22428
Closed
3 of 6 tasks
@opencode-agent opencode-agent Bot mentioned this pull request Oct 17, 2026
refactor(core): enable incremental auto-vacuum before WAL initialization #56365
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs:issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@zhumengzhu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.