Live data from Hacker News

Memory Profiling: Introduction

easyperf.net

1–10 of 19 posts

Re: Memory Profiling: Introduction

#3
post #2

http://kohlerm.blogspot.com/2009/02/how-to-really-measure-me... do we really still not have a decent memory usage analysis tool for c/ C++ ?

MAT is useful enough on its own to make me seriously consider Java almost everywhere. So many tricky memory leaks in other languages made completely trivial.

Yes, in many languages you can combine a few things plus a core dump and figure leaks out too... but average people actually use MAT because it's largely transparent, and it can operate on running processes. Very few languages can compete with that in practice, much less with reasonable performance.

Re: Memory Profiling: Introduction

#4
Some of our tools do so much allocation that capturing all the information (using MTuner) to disk and later loading require by itself hundreths of GB.

Instead I've added random sampling - e.g. if ptr % modulo > level - output it or not.

Another factor that slows down is doing a callstack capture. It's not for free at all, like on Windows it has to go through the exception handlers, etc. I think perfetto simply captures the whole stack (need to check again), and then offline decodes it - or something like this.

Windows ETW Tracing can also capture the stack, but I guess it'll incur also some penalty - it can't come for free.

I also wish there was some kind of standard binary format for emitting alloc/free sequences with callstack/etc.

Re: Memory Profiling: Introduction

#6
post #3
post #2

http://kohlerm.blogspot.com/2009/02/how-to-really-measure-me... do we really still not have a decent memory usage analysis tool for c/ C++ ?

MAT is useful enough on its own to make me seriously consider Java almost everywhere. So many tricky memory leaks in other languages made completely trivial. Yes, in many languages you can combine a few things plus a core dump and figure leaks out too... but average people actually use MAT because it's largely transparent, and it can operate on running processes. Very few languages can compete with that in practice,…

Is there a tool for the jvm that can track data locality? TFA mentions three for Linux binaries but that won’t do the mapping to Java source if we can combine them with `java -jar` at all.

Re: Memory Profiling: Introduction

#8
post #2

http://kohlerm.blogspot.com/2009/02/how-to-really-measure-me... do we really still not have a decent memory usage analysis tool for c/ C++ ?

> do we really still not have a decent memory usage analysis tool for c/ C++ ?

Shameless plug: not sure if I'd call it decent, but you might want to check my Bytehound for more in-depth analysis:

https://github.com/koute/bytehound

Re: Memory Profiling: Introduction

#9
post #4

Some of our tools do so much allocation that capturing all the information (using MTuner) to disk and later loading require by itself hundreths of GB. Instead I've added random sampling - e.g. if ptr % modulo > level - output it or not. Another factor that slows down is doing a callstack capture. It's not for free at all, like on Windows it has to go through the exception handlers, etc. I think perfetto simply captur…

> Instead I've added random sampling - e.g. if ptr % modulo > level - output it or not.

A good alternative that also cuts down on the amount of data significantly is to strip away temporary allocations, say, only emit those allocations which were alive for at least X seconds.

Post reply on HN