Skip to content

Commit ffd0f24

Browse files
gballetSahil-4555
authored andcommitted
cmd/keeper: disable GC for zkvm execution (ethereum#32638)
ZKVMs are constrained environments that liberally allocate memory and never release it. In this context, using the GC is only going to cause issues down the road, and slow things down in any case.
1 parent 2212751 commit ffd0f24

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/keeper/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package main
1919
import (
2020
"fmt"
2121
"os"
22+
"runtime/debug"
2223

2324
"github.com/ethereum/go-ethereum/core"
2425
"github.com/ethereum/go-ethereum/core/stateless"
@@ -35,6 +36,10 @@ type Payload struct {
3536
Witness *stateless.Witness
3637
}
3738

39+
func init() {
40+
debug.SetGCPercent(-1) // Disable garbage collection
41+
}
42+
3843
func main() {
3944
input := getInput()
4045
var payload Payload

0 commit comments

Comments
 (0)