You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# bundle is the full path to the cached jemalloc binaries for this version.
bundle=$CACHE_DIR/jemalloc/$STACK/$version
This correctly ensures that a recompile happens if the stack or requested jemalloc version changes.
However, currently the buildpack does not remove these cached items on cache miss, meaning the cache will continue to grow in size each time the stack or requested jemalloc version changes (unless users know to manually clear their build cache using a special CLI plugin).
To resolve this, the buildpack could do an rm -rf "${CACHE_DIR}/jemalloc/" on cache miss before the download/recompile, here:
echo"-----> jemalloc: Installing $version from source"
download
compile
The text was updated successfully, but these errors were encountered:
edmorley
changed the title
Purge old jemalloc files from cache on cache miss (eg stack or jemalloc version change)
Purge old jemalloc files from cache on cache miss (eg on stack or jemalloc version change)
Jun 25, 2024
My original intent with not clearing the cached builds was to make it possible to revert to a previously built version of jemalloc without having to deploy. Realistically though that's confusing since you have to build a new slug in order to use a version you've never deployed before.
Purging the builds would probably work but I'd like to noodle on it. Fortunately each build is ~6MB and the cadence of Heroku stack and jemalloc releases is both rather slow.
Another option would be to only clear the cache for stacks other than the current one. Compressing the build artifacts would also reduce them down to ~2MB.
This buildpack compiles jemalloc during the build and caches the result under a stack and jemalloc-specific path:
heroku-buildpack-jemalloc/bin/compile
Lines 37 to 38 in a7fe927
This correctly ensures that a recompile happens if the stack or requested jemalloc version changes.
However, currently the buildpack does not remove these cached items on cache miss, meaning the cache will continue to grow in size each time the stack or requested jemalloc version changes (unless users know to manually clear their build cache using a special CLI plugin).
To resolve this, the buildpack could do an
rm -rf "${CACHE_DIR}/jemalloc/"
on cache miss before the download/recompile, here:heroku-buildpack-jemalloc/bin/compile
Lines 116 to 121 in a7fe927
The text was updated successfully, but these errors were encountered: