0

I need to find something theoretically easy, but practically tricky.

Having a bunch of tools under OSX, some are:

  • precompiled java jars,
  • precompiled executables which can spawn and call other programs,
  • bash/python/perl scripts that call some precompiled executables,

I need to find and classify memory and cache events. By precompiled I mean, I don't have access to source codes.

In details I'd need to find out the overall occupied memory, page faults and virtual memory events, but more importantly, L1/L2/L3 cache misses. This means that I need to track all the spawned processes as well, not just the main program.

Any hints are welcome!

senseiwa
  • 2,369
  • 3
  • 24
  • 47
  • I do not know OSX, but on the systems I know (Windows, Linux or FreeBSD) I would search among the standard monitoring tools. I think they should meet the greatest part of your requirement. Then I would look in system libraries for what would still remains... – Serge Ballesta Dec 13 '15 at 11:00

1 Answers1

1

I think that you should use Valgrind. To have a full report of memory usage:

valgrind --tool=massif --stacks=yes

This will give you both the heap and stack memory usage. Then the information are stored in the file massif.out.???? that you can read with

ms_print massif.out.?????

I already wrote a post on this: post

Valgrind also records cache events, it gives you the cache misses and a full detailed output of cache events:

valgrind --tool=cachegrind prog

And then as for the massif you have a tool to read the detailed output:

cg_annotate <filename>

Refer to the full documentation to understand the output. The option --trace-children=yes permits to profile spawned child

Community
  • 1
  • 1
terence hill
  • 3,354
  • 18
  • 31