Skip to content
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

replace time.After to time.NewTimer #181

Merged
merged 2 commits into from
Sep 21, 2022

Conversation

0xcb9ff9
Copy link

Description

time.After exist memory leak

photo_2022-09-21_11-20-14

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

create pprof file

$ go test -coverprofile coverage.out -timeout 28m -memprofile mem.pprof ./txpool

analysis pprof file

$ go tool pprof -http 0.0.0.0:8080 -no_browser mem.pprof

browser open http://0.0.0.0:8080

@0xcb9ff9 0xcb9ff9 self-assigned this Sep 21, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #181 (d887d5c) into dev (20f2db1) will increase coverage by 0.08%.
The diff coverage is 53.84%.

@@            Coverage Diff             @@
##              dev     #181      +/-   ##
==========================================
+ Coverage   51.27%   51.35%   +0.08%     
==========================================
  Files         113      113              
  Lines       16875    16881       +6     
==========================================
+ Hits         8652     8670      +18     
+ Misses       7485     7474      -11     
+ Partials      738      737       -1     
Impacted Files Coverage Δ
consensus/ibft/ibft.go 37.11% <20.00%> (-0.08%) ⬇️
protocol/sync_peer.go 70.00% <50.00%> (+1.00%) ⬆️
protocol/testing.go 84.03% <66.66%> (+0.13%) ⬆️
network/server.go 75.31% <100.00%> (+0.53%) ⬆️
network/server_discovery.go 80.89% <0.00%> (+7.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

network/server.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job. 💯

A little bit change would make it better.

@0xcb9ff9 0xcb9ff9 added the bug fix Functionality that fixes a bug label Sep 21, 2022
@DarianShawn DarianShawn self-requested a review September 21, 2022 06:16
@DarianShawn DarianShawn merged commit fae7a9d into dogechain-lab:dev Sep 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2022
@0xcb9ff9 0xcb9ff9 deleted the fix_time_after_memory_leak branch September 21, 2022 06:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants