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

[Core] Investigate memory leaks, manual GC on ResetToGenesis - (Issue #440) #445

Merged
merged 9 commits into from
Jan 24, 2023
3 changes: 3 additions & 0 deletions persistence/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package persistence
import (
"crypto/sha256"
"log"
"runtime/debug"

"github.com/celestiaorg/smt"
"github.com/pokt-network/pocket/persistence/types"
Expand Down Expand Up @@ -89,6 +90,8 @@ func (m *persistenceModule) clearAllState(_ *messaging.DebugMessage) error {
}

log.Println("Cleared all the state")
// reclaming memory manually because the above calls deallocate and reallocate a lot of memory
debug.FreeOSMemory()
return nil
}

Expand Down
1 change: 1 addition & 0 deletions persistence/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.0.0.23] - 2023-01-18

- Consolidate the `Block` proto structures under `shared/core/types`
deblasis marked this conversation as resolved.
Show resolved Hide resolved
- Added `debug.FreeOSMemory()` on `ResetToGenesis` to free-up memory and stabilize `LocalNet`.
Copy link
Member

Choose a reason for hiding this comment

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

Prob need to update this now


## [0.0.0.22] - 2023-01-14

Expand Down