xinyiZzz opened a new pull request, #34578:
URL: https://github.com/apache/doris/pull/34578

   ## Proposed changes
   
   Now in order to support malloc hook, compiling jemalloc will add tow 
compilation options `--with-jemalloc-prefix=je` and `--disable-cxx`, then 
overwrite malloc/free as follows to allow BE to use jemalloc:
   ```
   #define ALIAS(doris_fn) __attribute__((alias(#doris_fn), used))
   void* malloc(size_t size) __THROW ALIAS(doris_malloc);
   void free(void* p) __THROW ALIAS(doris_free);
   void* realloc(void* p, size_t size) __THROW ALIAS(doris_realloc);
   void* calloc(size_t n, size_t size) __THROW ALIAS(doris_calloc);
   void cfree(void* ptr) __THROW ALIAS(doris_cfree);
   ```
   
   but after such overwrite like this, Doris BE on jdk17 cannot be started in 
some environments.
   there are three solutions:
   1. Modify overwrite malloc/free, fixed in 
https://github.com/apache/doris/pull/33897
   2. Modify BE dynamically loads JVM, fixed in 
https://github.com/apache/doris/pull/32865
   3. Commit of this PR, modify jemalloc compilation options, after remove 
`--with-jemalloc-prefix=je`, there is not need to overwrite malloc/free, BE 
will use Jemalloc by default. 
   
   So,  if need to use memory hook, this PR still cannot solve this problem.
   Looking forward to modify BE dynamically loads JVM, which will not only 
solve this problem, also fix other crashes caused by BE use JVM.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to