fluent-package-builder icon indicating copy to clipboard operation
fluent-package-builder copied to clipboard

macOS version doesn't use jemalloc

Open ashie opened this issue 2 years ago • 12 comments

Although dmg package for macOS bundles jemalloc as same as packages for linux platforms, it doesn't use jemalloc. To enable it, LD_PRELOAD environment variable is required. But probably no one sets it on macOS.

ashie avatar Jul 28 '21 06:07 ashie

Probably we need to add EnvironmentVariables to td-agent.plist.

ashie avatar Jul 28 '21 06:07 ashie

@ashie will you fix for 4.2.0?

kenhys avatar Jul 28 '21 08:07 kenhys

No. I'm in final testing for 4.2.0. It should be fixed in future version.

ashie avatar Jul 28 '21 08:07 ashie

FYI; td-agent 4.5.0 (or under version?) has dead lock issue on macOS. If we use jemalloc on macOS, we might have to revert to downgrade jemalloc version. https://github.com/jemalloc/jemalloc/issues/895

cosmo0920 avatar Jul 28 '21 08:07 cosmo0920

And also, we should use DYLD_LIBRARY_PATH on macOS instead of LD_LIBRARY_PATH to replace malloc implementation with jemalloc.

cosmo0920 avatar Jul 28 '21 08:07 cosmo0920

FYI; td-agent 4.5.0 (or under version?) has dead lock issue on macOS.

Thanks for the information. Do you mean jemalloc?

- td-agent 4.5.0
+ jemalloc 4.5.0

It seems that it's affect to jemalloc 4.5.0 - 5.0.0. <= 4.4.0 or >= 5.1.0 aren't affected.

  • https://github.com/jemalloc/jemalloc/releases/tag/5.1.0
  • https://github.com/rust-lang/rust/pull/41861
    • https://github.com/rust-lang/jemalloc/compare/11bfb0dcf85f7aa92abd30524bb1e42e18d108c6...3288e0659c08fb5006f6d6dd4b5675ed0c2c432a

If we use jemalloc on macOS, we might have to revert to downgrade jemalloc version. https://github.com/jemalloc/jemalloc/issues/895

td-agent 4.2.0 includes an amazing challenge for jemalloc. It downgrades jemalloc to 3.6.0: #305

ashie avatar Jul 28 '21 09:07 ashie

And also, we should use DYLD_LIBRARY_PATH on macOS instead of LD_LIBRARY_PATH to replace malloc implementation with jemalloc.

You are right, I forgot it. Thanks for notifying it.

ashie avatar Jul 28 '21 09:07 ashie

FYI; td-agent 4.5.0 (or under version?) has dead lock issue on macOS.

BTW it might not be so critical for Ruby, because it uses Giant VM Lock.

ashie avatar Jul 28 '21 09:07 ashie

Thanks for the information. Do you mean jemalloc?

Yes, I mean jemalloc.

cosmo0920 avatar Jul 28 '21 09:07 cosmo0920

It seems that it's affect to jemalloc 4.5.0 - 5.0.0. <= 4.4.0 or >= 5.1.0 aren't affected.

  * [rust-lang/[email protected]](https://github.com/rust-lang/jemalloc/compare/11bfb0dcf85f7aa92abd30524bb1e42e18d108c6...3288e0659c08fb5006f6d6dd4b5675ed0c2c432a)

No, it bumped from 4.1.0 to 4.5.0. So 4.1.1 - 5.0.0 are possible to be affected.

ashie avatar Jul 28 '21 09:07 ashie

Oh, it's widely spreaded issue...

cosmo0920 avatar Jul 28 '21 09:07 cosmo0920

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

github-actions[bot] avatar Feb 14 '22 10:02 github-actions[bot]