Ian Cook created ARROW-16717:
--------------------------------

             Summary: [C++] Enable Arrow to share an application's jemalloc 
instance
                 Key: ARROW-16717
                 URL: https://issues.apache.org/jira/browse/ARROW-16717
             Project: Apache Arrow
          Issue Type: New Feature
          Components: C++
    Affects Versions: 8.0.0
            Reporter: Ian Cook


Is there any good way for an application that uses Arrow to tell Arrow to share 
its own jemalloc instance?

Normally when Arrow uses jemalloc, it creates its own instance of it. The only 
method that I think would work to get Arrow to use the same jemalloc instance 
as the application would be to do something hacky like this:

 * Patch {{cpp/src/arrow/memory_pool.cc}} to use the application's jemalloc 
header
 * Configure the application's jemalloc instance to use the same configuration 
that Arrow uses, as shown in {{je_arrow_malloc_conf}}
 * Patch {{ThirdpartyToolchain.cmake}} to use the application's jemalloc 
instance

Is there any non-hacky way to achieve this? If not, would it be possible to add 
a feature to Arrow to enable the user to tell it to use a specific jemalloc 
instance at runtime?

The benefit of this would be that a unified jemalloc instance could (at least 
hypothetically) allocate memory more efficiently than two separate ones running 
on the same machine.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to