0

I want to use jemalloc for memory profiling of DLLs.

I am using jemalloc 4.3.0. I build it in Microsoft Visual Studio 2015.

Now how can jemalloc.dll be used in the application?

The application is in Java and it uses native code written in C++. My OS is Windows 7, 32-bit.

underscore_d
  • 6,309
  • 3
  • 38
  • 64
gari
  • 11
  • 3
  • Is your C++ code using `new` or `std::allocator` or `std::make_shared` ? (I.e. C++ functions). In that case, it would be trivial - just override `::operator new` to call `jemalloc`. The problem is that you can't override `malloc`. – MSalters Jan 17 '18 at 13:30
  • @MSalters : C++ code is using new and malloc. so is it that I have to manually change the malloc to jemalloc ? Is there any way that all the mallocs being replaced to jemalloc by just including the dll. As i have seen post that in unix we just have to Use the LD_PRELOAD environment variable to inject jemalloc into the application at run time. https://github.com/jemalloc/jemalloc/wiki/Getting-Started – gari Jan 19 '18 at 16:11

0 Answers0