Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit c4f770a

Browse files
authored
Restores memory footage report (#1194)
* restore memory footage report * Fix aida-sdb extension order
1 parent 9a4ee70 commit c4f770a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

cmd/aida-sdb/trace/replay.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func (p operationProcessor) runTransaction(block uint64, operations []operation.
8888
func replay(cfg *utils.Config, provider executor.Provider[[]operation.Operation], processor executor.Processor[[]operation.Operation], extra []executor.Extension[[]operation.Operation], aidaDb db.BaseDB) error {
8989
var extensionList = []executor.Extension[[]operation.Operation]{
9090
profiler.MakeCpuProfiler[[]operation.Operation](cfg),
91+
statedb.MakeStateDbManager[[]operation.Operation](cfg, ""),
9192
profiler.MakeMemoryUsagePrinter[[]operation.Operation](cfg),
9293
profiler.MakeMemoryProfiler[[]operation.Operation](cfg),
93-
statedb.MakeStateDbManager[[]operation.Operation](cfg, ""),
9494
logger.MakeProgressLogger[[]operation.Operation](cfg, 0),
9595
primer.MakeStateDbPrimer[[]operation.Operation](cfg),
9696
}

state/carmen.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,14 @@ func (s *carmenHeadState) GetArchiveBlockHeight() (uint64, bool, error) {
438438
}
439439

440440
func (s *carmenStateDB) GetMemoryUsage() *MemoryUsage {
441-
// todo waiting for implementation from carmen side
442-
//usage := s.db.GetMemoryFootprint()
443-
//if usage == nil {
444-
// return &MemoryUsage{uint64(0), nil}
445-
//}
446-
return &MemoryUsage{uint64(0), nil}
441+
if s.db == nil {
442+
return &MemoryUsage{uint64(0), nil}
443+
}
444+
usage := s.db.GetMemoryFootprint()
445+
if usage == nil {
446+
return &MemoryUsage{uint64(0), nil}
447+
}
448+
return &MemoryUsage{uint64(usage.Total()), usage}
447449
}
448450

449451
func (s *carmenStateDB) GetShadowDB() StateDB {

0 commit comments

Comments
 (0)