-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: add memory tracker for InsertExec and ReplaceExec #14179
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e4bffdb
*: add memory tracker for InsertExec and ReplaceExec
XuHuaiyu 99a6574
test
XuHuaiyu c6f9e29
fix ci
XuHuaiyu 1bb2640
fix ci
XuHuaiyu a9f2e5b
Merge branch 'master' of https://github.com/pingcap/tidb into trace-w…
XuHuaiyu ddfbbe1
remove useless code
XuHuaiyu 04d4dad
refine
XuHuaiyu 554f22c
remove useless code
XuHuaiyu d430227
add some tests
XuHuaiyu 1f6ed6e
refine code
XuHuaiyu 13edb1f
remove useless code
XuHuaiyu b55a29e
add test
XuHuaiyu dbc820c
fix ci
XuHuaiyu 0b61a15
test
XuHuaiyu 4797740
fix ci
XuHuaiyu c498234
address comment
XuHuaiyu 46e698d
fix ci
XuHuaiyu 80926b3
Merge branch 'master' into trace-write-memory
XuHuaiyu 3fb96e9
address comment
XuHuaiyu d69dd2c
Merge branch 'trace-write-memory' of https://github.com/XuHuaiyu/tidb…
XuHuaiyu 6419d09
address comment
XuHuaiyu 1df692f
address comment
XuHuaiyu 7b9ed07
address comment
XuHuaiyu 438ee6c
fix ci
XuHuaiyu 0fd2084
address comment
XuHuaiyu 0b63c28
address comment
XuHuaiyu 4859fa3
Merge branch 'master' of https://github.com/pingcap/tidb into trace-w…
XuHuaiyu 7625390
remove useless code
XuHuaiyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
address comment
- Loading branch information
commit 3fb96e98164bde60ae36203dd14d3d3dd971487a
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,10 +438,7 @@ func (s *session) getTxnFuture(ctx context.Context) *txnFuture { | |
|
||
// StmtCommit implements the sessionctx.Context interface. | ||
func (s *session) StmtCommit(memTracker *memory.Tracker) error { | ||
defer func() { | ||
s.txn.cleanup() | ||
memTracker.Consume(int64(-s.txn.Size())) | ||
}() | ||
defer s.txn.cleanup() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we follow code logic, this defer maybe need |
||
st := &s.txn | ||
txnSize := st.Transaction.Size() | ||
var count int | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement is finished and the memory is allocated when
StmtCommit
, I think it is meanless. Consume it attidb/session/txn.go
Line 260 in d666ed4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But stmtBuffer can be GCed after be written to txnBuffer?