sqlite: add DB.MemoryUsed accessor, add leak test to ExpandedSQL test#116
Closed
bradfitz wants to merge 1 commit into
Closed
sqlite: add DB.MemoryUsed accessor, add leak test to ExpandedSQL test#116bradfitz wants to merge 1 commit into
bradfitz wants to merge 1 commit into
Conversation
bradfitz
commented
Nov 3, 2025
raggi
reviewed
Nov 3, 2025
Updates tailscale/corp#34015 Signed-off-by: Brad Fitzpatrick <brad@danga.com>
7cf33f0 to
66136eb
Compare
bradfitz
commented
Nov 3, 2025
Comment on lines
+1554
to
+1562
| // Verify we didn't build with -DSQLITE_DEFAULT_MEMSTATUS=0. | ||
| // We want memory stats. | ||
| func TestDBMemoryUsed(t *testing.T) { | ||
| conn := getTestConn(t) | ||
| mem0 := conn.db.MemoryUsed() | ||
| if mem0 == 0 { | ||
| t.Error("MemoryUsed=0; want non-zero; did you build with -DSQLITE_DEFAULT_MEMSTATUS=0?") | ||
| } | ||
| } |
raggi
approved these changes
Nov 3, 2025
Contributor
|
Some benchmarks run on my MacBook, three runs:
That's a bigger impact than I expected. Maybe worth doing some better measurement? |
alisdair
requested changes
Nov 20, 2025
Contributor
alisdair
left a comment
There was a problem hiding this comment.
Not a strong -1, but I don't think the extra visibility is likely to be worth the cost, and GitHub keeps nagging me to leave a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updates tailscale/corp#34015