Skip to content

Commit

Permalink
Limit memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Apr 2, 2024
1 parent 613f0c2 commit b76d164
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var instance struct {

func compileSQLite() {
if RuntimeConfig == nil {
RuntimeConfig = wazero.NewRuntimeConfig().WithMemoryCapacityFromMax(true)
RuntimeConfig = wazero.NewRuntimeConfig().WithMemoryLimitPages(1024).WithMemoryCapacityFromMax(true)
}

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion vfs/tests/mptest/mptest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
func TestMain(m *testing.M) {
ctx := context.Background()
rt = wazero.NewRuntimeWithConfig(ctx,
wazero.NewRuntimeConfig().WithMemoryCapacityFromMax(true))
wazero.NewRuntimeConfig().WithMemoryLimitPages(1024).WithMemoryCapacityFromMax(true))
wasi_snapshot_preview1.MustInstantiate(ctx, rt)

env := vfs.ExportHostFunctions(rt.NewHostModuleBuilder("env"))
Expand Down

0 comments on commit b76d164

Please sign in to comment.