Skip to content

Compile jemalloc with Ruby by default

Stan Hu requested to merge sh-enable-jemalloc-default into master

What does this MR do?

For years the Ruby interpreter has been dynamically loaded with jemalloc by using LD_PRELOAD to replace the system's malloc calls. While this makes it possible to disable jemalloc, some anti-virus scanners flag this behavior and abort the Ruby interpreter.

Since jemalloc has:

  1. Significantly improved memory usage
  2. Is compiled with the default for Cloud Native GitLab images
  3. Is compiled with the default for all GitLab CI images

We should enable by this default and deprecate the configuration variable.

To do this, we need to install all jemalloc files, not just the library and binary files. This does not seem to have an impact on the final build image.

We also need to pass -Wl,--no-as-needed as a linker argument due to https://bugs.ruby-lang.org/issues/18409.

Related issues

Relates to #4357 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by Stan Hu

Merge request reports