graphql-engine/preload-mimalloc/update-sources.sh
kodiakhq[bot] 4d86cd3a62 Fix #9447 bad memory usage
A fix for #9447

Before this change, for the workload in the ticket, we saw a memory stay at around 4 GB an hour after the workload ended.  after this change we see both a lower memory high watermark, and also see memory come back to baseline at the end as we expect (after the `HASURA_GRAPHQL_PG_CONN_LIFETIME` and a subsequent `_idleStaleReaperThread` interval elapses).  But note the numbers given on any given machine may be slightly different, since the behavior depends on the version of glibc and processor speed (Since the test case depends on the server being overloaded).

This might also help some users commenting in https://github.com/hasura/graphql-engine/issues/9592

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9823
GitOrigin-RevId: 5650aa42d10d46c418c21686983a982d69011884
2023-07-25 11:24:57 +00:00

25 lines
784 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# You can use this to update the mimalloc source code vendored here, if you
# wish to upgrade the version for instance. This should be idempotent.
#
# NOTE!: v2.1.2 regresses from our point of view. See:
# https://github.com/microsoft/mimalloc/issues/776
VERSION=v2.1.1
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # ... https://stackoverflow.com/a/246128/176841
cd "$THIS_DIR"
rm -rf mimalloc
git clone git@github.com:microsoft/mimalloc.git 2>/dev/null
(
cd mimalloc
git checkout "$VERSION" 2>/dev/null
# stuff we don't need:
rm -rf .git docs doc cmake bin azure-pipelines.yml CMakeLists.txt .gitattributes .gitignore ide mimalloc.pc.in test
) # in mimalloc/
echo "Done. $VERSION vendored in 'mimalloc/'"