Skip to content

[oblib] Add ordinary purge for free blocks#953

Open
hnwyllmm wants to merge 1 commit into
masterfrom
task/2026062900117064257
Open

[oblib] Add ordinary purge for free blocks#953
hnwyllmm wants to merge 1 commit into
masterfrom
task/2026062900117064257

Conversation

@hnwyllmm

Copy link
Copy Markdown
Member

Task Description

The seekdb allocator could keep free blocks resident after chunks became partially unused. This made idle RSS less likely to drop after startup or allocation bursts.

Solution Description

Add ordinary purge of free blocks in the normal allocation/free path without adding a background timer. The purge path scans the existing BlockSet free lists, applies a time interval trigger, and limits each round by both bytes and the maximum number of free spans processed so CPU cost is bounded.
The change also preserves chunk-release cleanup for dirty/purged list references, exposes purged accounting through AChunkMgr, and adds BlockSet unit coverage for delayed ordinary purge behavior.

Passed Regressions

  • git diff --check
  • cd build_release && ob-make test_block_set
  • ./deps/oblib/unittest/lib/test_block_set
  • cd build_release && ob-make seekdb
  • Empty base-dir idle check: 3-minute RSS min 383112 KB, final 389132 KB.
  • Empty base-dir memory dump: dirty_free 9.89 MB, washed_free 60.73 MB, dirty_only_chunks 2.

Upgrade Compatibility

No upgrade compatibility impact. No new user-facing parameter is introduced.

Other Information

This MR intentionally does not include the local design document docs/memory_allocator_purge_design.md or local seekdb runtime directories.

Release Note

@hnwyllmm

Copy link
Copy Markdown
Member Author

The mapping Dima issue is about the [seekdb memory purge feature].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant