Skip to content

llvmPackages_13.clang: revert D100879 and re-enable jemalloc for firefox#148107

Merged
vcunat merged 2 commits intoNixOS:staging-nextfrom
oxalica:fix/clang-revert-malloc-assumption
Dec 15, 2021
Merged

llvmPackages_13.clang: revert D100879 and re-enable jemalloc for firefox#148107
vcunat merged 2 commits intoNixOS:staging-nextfrom
oxalica:fix/clang-revert-malloc-assumption

Conversation

@oxalica
Copy link
Contributor

@oxalica oxalica commented Dec 1, 2021

Motivation for this change

Revert the D100879 which causes #146382, so that we could re-enable jemalloc for firefox again.

Currently we disabled jemalloc in #146784 as a temporary workaround. But I found it makes firefox consumes significant more memory. As a simple comparison, I created an empty profile and run firefox with 5 tabs of https://github.com/NixOS/nixpkgs and 5 tabs of https://youtube.com . After loaded and stabilized, firefox without jemalloc consumes 3.30GiB+-1% RSS, while the jemalloc one consumes 2.94GiB+-2% RSS, which is ~10% reduction. (They both don't use any swap space)

The test and benchmarks are done by cherry-picking this PR to master.
staging one is still building.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@oxalica oxalica requested a review from matthewbauer as a code owner December 1, 2021 07:46
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Dec 1, 2021
@oxalica oxalica mentioned this pull request Dec 14, 2021
13 tasks
@thiagokokada
Copy link
Contributor

Should we backport this to release 21.05 and 21.11 🤔 ?

@oxalica
Copy link
Contributor Author

oxalica commented Dec 14, 2021

Should we backport this to release 21.05 and 21.11 thinking ?

I have not known that 21.05 also have LLVM 13. But it seems only chromium uses it and it doesn't use jemalloc together. There should be no packages affected by the issue. Well, applying the fix should still be good.

21.11 should include this. But let's make this get staging first.

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running firefox and thunderbird with this now. The RAM consumption difference is probably practically significant.

The rebuild amount isn't that large, let's at least compromise with staging-next.

@vcunat vcunat changed the base branch from staging to staging-next December 15, 2021 13:07
@vcunat vcunat merged commit 030e814 into NixOS:staging-next Dec 15, 2021
@vcunat
Copy link
Member

vcunat commented Dec 15, 2021

The PoC does not crash for me.

@github-actions
Copy link
Contributor

Successfully created backport PR #150844 for release-21.11.

@oxalica oxalica deleted the fix/clang-revert-malloc-assumption branch December 17, 2021 00:16
@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firefox high memory usage

4 participants