From 9f8bddd7c783f1253358167d0def047b1ce33461 Mon Sep 17 00:00:00 2001
From: Yuanxin Cao <60498509+xx01cyx@users.noreply.github.com>
Date: Sun, 17 Nov 2024 13:46:05 -0500
Subject: [PATCH] fix: fix web shell OOM issue (#775)
---
CMakeLists.txt | 6 ++++++
tools/wasm-shell/extra_files/index.html | 8 ++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 471135127..b599bc1ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,12 @@ endif()
if(EMSCRIPTEN)
add_compile_options(-fexceptions)
add_link_options(-fexceptions)
+
+ # Memory configuration
+ add_compile_options(-sALLOW_MEMORY_GROWTH=1)
+ add_compile_options(-sMAXIMUM_MEMORY=64MB)
+ add_link_options(-sALLOW_MEMORY_GROWTH=1)
+ add_link_options(-sMAXIMUM_MEMORY=64MB)
endif()
# People keep running CMake in the wrong folder, completely nuking their project or creating weird bugs.
diff --git a/tools/wasm-shell/extra_files/index.html b/tools/wasm-shell/extra_files/index.html
index 0913af9c7..707d78f8c 100644
--- a/tools/wasm-shell/extra_files/index.html
+++ b/tools/wasm-shell/extra_files/index.html
@@ -30,10 +30,10 @@
-
-
-
-
+
+
+
+