Comments (11)
TCMalloc isn't the C++ compiler. TCMalloc is a memory allocator.
from tcmalloc.
@junyer Yes, I know TCMalloc is a memory allocator. Please take a closer look at my question. My question is that after using tcmalloc to run the program, there are still a lot of dynamic memory allocations in my program caused by using std::vector.
from tcmalloc.
Please clarify (a) what a memory allocator should have done, (b) how that could have been done and (c) which memory allocators would have done that. At the risk of stating the obvious, a memory allocator is a library that allocates memory; expecting it to "optimise" how it gets called is like expecting libc to "optimise" how it gets called to, say, fopen(3)
and fclose(3)
FILE
s. There's nothing here beyond wishful thinking.
from tcmalloc.
a) these are not tcmalloc function names. are you sure that program using tcmalloc?
b) tcmalloc has limited cpu cache bounds, so it's not true that there won't be any allocations after a few minutes
from tcmalloc.
Indeed, various caches are bounded in various ways. Moreover, it's conceivable that at least some allocations are larger than kMaxSize
.
from tcmalloc.
a) these are not tcmalloc function names. are you sure that program using tcmalloc? b) tcmalloc has limited cpu cache bounds, so it's not true that there won't be any allocations after a few minutes
a. I use tcmalloc to load my program in the following way.
LD_PRELOAD=path/to/gperftools/lib/libtcmalloc.so ./my_test_program
b. I noticed that github:tcmalloc has the MallocExtension::instance()->SetMaxPerCpuCacheSize
interface, but these interfaces are not in github:gperftools. I did some configuration by using the github:gperftools's MallocExtension::instance()->SetNumericProperty( "tcmalloc.max_total_thread_cache_bytes", 100 * 1024 * 1024);
interface, but it had no effect.
from tcmalloc.
Is there some reason why this issue wasn't filed against https://github.com/gperftools/gperftools?
from tcmalloc.
If you aren't using TCMalloc as provided by this project, is there some reason to seek support from this project? gperftools is a separate (older) project with a different (older) implementation of TCMalloc that, in particular, doesn't offer per-CPU caching.
from tcmalloc.
I see you filed gperftools/gperftools#1517, so I think we are done here.
from tcmalloc.
Spamming unrelated projects is bad open source citizenship, IMO, but good luck with that.
from tcmalloc.
It's also worth noting that even the issue title ("tcmalloc cannot optimize dynamic memory allocation caused by std::vector.") is at best a miscommunication and at worst a misrepresentation. It's unclear that there's any problem here beyond your misunderstanding of how to behave towards open source projects and how to respect people's time and attention.
from tcmalloc.
Related Issues (20)
- GWP-ASan may report segv in multi-thread when write_overflow/double_free detected at free?
- Is there a debugging document of tcmalloc? HOT 7
- mmap failed, when offset is physical address HOT 3
- missing-field-initializer HOT 1
- can you provide .so for me to use HOT 8
- tcmalloc crash when /sys/devices/system/cpu/possible is sandboxed away HOT 6
- tcmalloc making syscall madvise(MADV_DONTNEED) from a NOHZ_FULL cpu is causing the kernel to kick the CPU by raising a local timer interrupt HOT 2
- what's difference with gperftools? HOT 2
- request support triggger GWP-ASan by environment variables
- what is the relationship between tcmalloc and abseil library HOT 4
- tcmalloc::MallocExtension::PerCpuCachesActive() returning false HOT 3
- Empty if statement for invoke_hooks? HOT 1
- ARM use libnvinfer.so and tcmalloc.so crash HOT 1
- build tcmalloc failed HOT 7
- Use GetStats without TCMalloc in project's build system.
- ProcessBackgroundActions and max cache sizes tuning questions HOT 15
- bazel build failed
- only want libtcmalloc.so not libtcmalloc.lo
- How tcmalloc allocator for STLοΌ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcmalloc.