I am currently interested in user-level memory allocator and TCmalloc from google.
I saw this page that shows some evaluation to comparing PTmalloc2 and TCmalloc.
I want to rebuild that experiment in my environment.
So, I installed TCmalloc from an official reference from here.
and also install golang for using profiling tool that called 'pprof' to this command
sudo snap install --classic go
then, install google-pprof tools
go install github.com/google/pprof@latest
above command get from here
finally, I just tested TCmalloc with Tensorflow MNIST python code using LD_PRELOAD
LD_PRELOAD=/usr/lib/libtcmalloc.so.4 python3 MNIST.py
It works.
And Generated heap profile binary(.heap)
LD_PRELOAD=/usr/lib/libtcmallo.so.4 HEAPPROFILE=log python3 MNIST.py
It works too.
Analyzing by using google-pprof also works.
And tried CPUPROFILE
with under code
LD_PRELOAD=/usr/lib/libtcmallo.so.4 CPUPROFILE=cpu python3 MNIST.py
It didn't work. There is no output.
What am I missing?
-my system-
Ubuntu 20.04.1LTS x86-64 5.13.0-35
gcc/g++: 9.4.0
CPU: Intel i9-12900KF
MEMORY: 32GB
Thanks for your attention.
I’m looking forward to any reply.