Merge pull request #5101 from filecoin-project/raulk/memory-watchdog

introduce memory watchdog; LOTUS_MAX_HEAP
This commit is contained in:
Łukasz Magiera
2020-12-03 15:46:09 +01:00
committed by GitHub
6 changed files with 155 additions and 7 deletions
+7 -1
View File
@@ -15,6 +15,7 @@ import (
"github.com/filecoin-project/lotus/chain/vm"
"github.com/filecoin-project/lotus/chain/wallet"
"github.com/filecoin-project/lotus/node/hello"
"github.com/filecoin-project/lotus/system"
logging "github.com/ipfs/go-log"
ci "github.com/libp2p/go-libp2p-core/crypto"
@@ -111,8 +112,10 @@ const (
// the system starts, so that it's available for all other components.
InitJournalKey = invoke(iota)
// libp2p
// System processes.
InitMemoryWatchdog
// libp2p
PstoreAddSelfKeysKey
StartListeningKey
BootstrapKey
@@ -174,6 +177,9 @@ func defaults() []Option {
Override(new(journal.DisabledEvents), journal.EnvDisabledEvents),
Override(new(journal.Journal), modules.OpenFilesystemJournal),
Override(new(system.MemoryConstraints), modules.MemoryConstraints),
Override(InitMemoryWatchdog, modules.MemoryWatchdog),
Override(new(helpers.MetricsCtx), func() context.Context {
return metricsi.CtxScope(context.Background(), "lotus")
}),