タグ

performanceとdtraceに関するmanabouのブックマーク (2)

  • How to use dtrace to determine the maximum memory usage of a process

    First, your dtrace script will give you an upper bound on the maximum memory utilization since you don't track frees as well as mallocs. You might not care about this. If you do care, since free doesn't take in or return the size of the freed range, you might be better off tracing the brk() syscall return value, which also accounts for the size of all metadata that malloc stores on the heap. The a

    How to use dtrace to determine the maximum memory usage of a process
  • あなたの知らない time(1) の世界 - kuenishi's blog

    自分が書いたプログラムのメモリ使用量を測定したいことがある。プログラムがOOM Killerによってお亡くなりになった場合や、ページフォルトをなくして高速化したい場合などだ。定常的に起動するサーバーのプログラムなら、sarや meminfo など(今なら Datadog とかだろうか)を使ってじーっと見つめるわけだ。もっとモダンにやるなら perf や DTrace を使ってもよいかもしれない。しかしこれらのツールは基的にプロセスIDを渡してサンプリングして外から覗く方法だ。 わたしのユースケースはデーモンプロセスではなく、 main から入って必要な計算をして、それが終わったら main を抜けるバッチジョブ(単にコンソールから実行して終わるまで待つ、いわゆる "Hello world!" 的なやつ)だ。これだと、プログラムが起動して終わるまでそこそこの時間で終わってしまって、外部プロ

    あなたの知らない time(1) の世界 - kuenishi's blog
  • 1