jemalloc apparently is faster than glibc for memory-wasting multithreaded software (RAM is just as wasted if you fill it up to OOM than not using it), but glibc seems to be faster and use less memory if you aren't using all the memory and allow for other software.
jemalloc seems to be used to compensate for poor programming and also since it has a weak license (as the power to take freedom must be granted).
@a1ba >in which case the licensing doesn't play any role (as GPL explicitly refers to it as "System Libraries"). glibc is licensed under the LGPLv2.1-or-later and if you compile software against it, you need to meet the requirements of allowing the user to modify the library and debug their modifications (even via reverse engineering).
The "system libraries" exception in the GPLv3 is a limited exception, allowing for a GPLv3+ program to be linked to an existing proprietary libc on a proprietary OS for example, without permitting the writing of proprietary derivative works.
glibc malloc is not the fastest or most memory-efficient malloc, but it is the fastest malloc that is portable and also memory-efficient - it's all a tradeoff and glibc malloc makes the best tradeoffs.
@Suiseiseki I personally do use whatever default malloc on target platform is, in which case the licensing doesn't play any role (as GPL explicitly refers to it as "System Libraries").
However, I'm more interested in hearing the reasons why somebody decides not to rely on it and use thirdparty implementation. Having same algorithm, yeah, that could work. Even if GC but again, can't see how existing software written in C should even rely on that.
@a1ba >because it's considered as a system library and goes into an exception. The LGPLv2.1 does not have a the "system library" exception, it has a different one; `For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.`
Such exception does not give unlimited permission to link to glibc - it merely allows compiling and linking glibc on a proprietary system.
>It's good that glibc is GPL licensed There is no such thing as "GPL licensed", there is the GPLv{1,2,3}, LGPLv{2,2.1,3} & AGPLv{1,2,3}, all of which differ in detail.
>I wish GPL actually covered non-obfuscation case better because GNU people seem doesn't know how to write a readable code. The GPLv3 makes it clear that obfuscated code is object code and not source code; `The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.`
>GNU people seem doesn't know how to write a readable code. When I read GNU software, all I see is pure freedom, which is plenty readable.
@Suiseiseki that's what I mean, I don't care about libc licensing because it's considered a system library and goes into an exception.
It's good that glibc is GPL licensed and I looked into it's source code several times, however I wish GPL actually covered non-obfuscation case better because GNU people seem doesn't know how to write a readable code.