Skip to content

Commit

Permalink
Reduce memory limits for release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
apbassett committed Oct 10, 2024
1 parent 8b0e9b3 commit 3211bb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ jobs:
smoke-test-linux-arm64:
needs: ["build-linux"]
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
Expand All @@ -264,15 +264,6 @@ jobs:
mkdir ./amalgam
tar -xvf ./amalgam-${{ inputs.version }}-linux-arm64.tar.gz -C ./amalgam
- name: Install qemu-user-static
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static binfmt-support
- name: Register qemu binaries
run: |
sudo update-binfmts --enable qemu-arm
- name: Smoke test
uses: pguyot/arm-runner-action@v2
with:
Expand All @@ -288,7 +279,7 @@ jobs:
smoke-test-linux-arm64_8a:
needs: ["build-linux"]
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
Expand All @@ -300,15 +291,6 @@ jobs:
mkdir ./amalgam
tar -xvf ./amalgam-${{ inputs.version }}-linux-arm64_8a.tar.gz -C ./amalgam
- name: Install qemu-user-static
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static binfmt-support
- name: Register qemu binaries
run: |
sudo update-binfmts --enable qemu-aarch64
- name: Smoke test
uses: pguyot/arm-runner-action@v2
with:
Expand Down
8 changes: 7 additions & 1 deletion build/cmake/global_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" S
# TODO 1599: WASM support is experimental, these flags will be cleaned up and auto-generated where possible
if(IS_WASM)
string(APPEND CMAKE_CXX_FLAGS " -sMEMORY64=2 -Wno-experimental -DSIMDJSON_NO_PORTABILITY_WARNING")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -sINVOKE_RUN=0 -sALLOW_MEMORY_GROWTH=1 -sINITIAL_HEAP=65536000 -sSTACK_SIZE=33554432 -sMEMORY_GROWTH_GEOMETRIC_STEP=0.50 -sMODULARIZE=1 -sEXPORT_NAME=AmalgamRuntime -sENVIRONMENT=worker,node,web -sEXPORTED_RUNTIME_METHODS=cwrap,ccall,FS,setValue,getValue,UTF8ToString -sEXPORTED_FUNCTIONS=_malloc,_free,_LoadEntity,_CloneEntity,_VerifyEntity,_StoreEntity,_ExecuteEntity,_ExecuteEntityJsonPtr,_DestroyEntity,_GetEntities,_SetRandomSeed,_SetJSONToLabel,_GetJSONPtrFromLabel,_SetSBFDataStoreEnabled,_IsSBFDataStoreEnabled,_GetVersionString,_SetMaxNumThreads,_GetMaxNumThreads,_GetConcurrencyTypeString,_DeleteString --preload-file /wasm/tzdata@/tzdata --preload-file /wasm/etc@/etc")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -sINVOKE_RUN=0 -sALLOW_MEMORY_GROWTH=1 -sMEMORY_GROWTH_GEOMETRIC_STEP=0.50 -sMODULARIZE=1 -sEXPORT_NAME=AmalgamRuntime -sENVIRONMENT=worker,node,web -sEXPORTED_RUNTIME_METHODS=cwrap,ccall,FS,setValue,getValue,UTF8ToString -sEXPORTED_FUNCTIONS=_malloc,_free,_LoadEntity,_CloneEntity,_VerifyEntity,_StoreEntity,_ExecuteEntity,_ExecuteEntityJsonPtr,_DestroyEntity,_GetEntities,_SetRandomSeed,_SetJSONToLabel,_GetJSONPtrFromLabel,_SetSBFDataStoreEnabled,_IsSBFDataStoreEnabled,_GetVersionString,_SetMaxNumThreads,_GetMaxNumThreads,_GetConcurrencyTypeString,_DeleteString --preload-file /wasm/tzdata@/tzdata --preload-file /wasm/etc@/etc")
# Set memory arguments
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -sINITIAL_HEAP=65536000 -sSTACK_SIZE=33554432")
else()
string(APPEND CMAKE_EXE_LINKER_FLAGS " -sINITIAL_HEAP=16777216 -sSTACK_SIZE=8388608")
endif()
endif()

elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand Down

0 comments on commit 3211bb2

Please sign in to comment.