Closed gaffneyc closed 6 years ago
We run a semi-parallel fork of mojodna's repo at https://github.com/scryfall/heroku-buildpack-jemalloc, and we've been having a mysterious issue with 5.1.0 and Node 9:
Shortly after the node process starts, messages like these are printed:
node[15]: pthread_create: Invalid argument
node[16]: pthread_create: Invalid argument
The message seems to not affect anything afterward, but it becomes a problem when you expect the Node process to print exactly a certain string and nothing else (like if you're using ExecJS).
I have not been able to reproduce this on a local machine, only Heroku apps, which has made debugging difficult.
Thanks for the report! To double check, you're on the heroku-16 stack right? And are you passing any flags to ./configure
? It looks like jemalloc has --enable-lazy-lock
which wraps pthread_create
to detect when multithreading is used.
Yes, heroku-16. The only configure option is --prefix=/app/vendor/jemalloc
.
@gaffneyc I was planning to use jemalloc with ruby. It was advised by @nateberkopec (https://www.speedshop.co/2017/12/04/malloc-doubles-ruby-memory.html) that 3.6 is the version to go, since (by the post time) 5.0's performance with ruby was unknown.
In https://github.com/mojodna/heroku-buildpack-jemalloc/pull/18 you said that you are using this branch with version 5.0 on puma and sidekiq.
Would you say that 5.1.0 is "safe" enough for Rails applications?
@rafaelcgo Yes, I would say so. We've been using 5.1.0 on Dead Man's Snitch since early May and it's been working really well.
I'm planning to make 5.1.0 the default but haven't had any free time recently.
The newest version of jemalloc was released on 2018-05-08. It's a recommended upgrade by the authors (see the release notes). This is a tracking ticket for switching the default from 5.0.1 to 5.1.0.
Rough target is 2018-07-02.
To try out the new version run the below command then push a code change.
If you run into any issues with 5.1.0 please post details on this issue.