TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Measure Memory Allocation Cost, by Eliminating It

7 pointsby crispweedover 9 years ago

1 comment

joeld42over 9 years ago
This is a good approach. Even if you aren&#x27;t doing a &quot;replay&quot; allocator like this, having a custom allocator that records what happens can give lots of insight into the allocation patterns of your code.<p>One point I think a lot of people miss about custom allocators is that you don&#x27;t write a custom allocator because you can do a &quot;better job&quot; than the library authors (well, sometimes you do, but hopefully you can assume that the platform authors know more about their platform than you do). But platform authors have to solve the general case. You can usually do better for your specific case. So your allocator is not going to be better than vanilla malloc&#x2F;free for other programs, but you can tune it to fit your allocation patterns.