Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] Consing report from the profiler

Expand Messages
  • Jon Harrop
    ... It doesn t give you a breakdown of allocation by each function, as gprof gives a breakdown of time spent in each function, but you can get some simple
    Message 1 of 4 , Jul 4, 2007
    • 0 Attachment
      On Wednesday 04 July 2007 10:39:57 Joel Reymont wrote:
      > I haven't profiled in OCaml yet so forgive me the simple question:
      >
      > Does the OCaml profiler report consing and garbage collection
      > statistics?

      It doesn't give you a breakdown of allocation by each function, as gprof gives
      a breakdown of time spent in each function, but you can get some simple
      statistics of overall allocation and collection statistics with
      Gc.print_stat:

      # Gc.print_stat stdout;;
      minor_words: 104260
      promoted_words: 43626
      major_words: 83770
      minor_collections: 3
      major_collections: 1
      heap_words: 122880
      heap_chunks: 2
      top_heap_words: 122880
      live_words: 83770
      live_blocks: 18740
      free_words: 39109
      free_blocks: 1
      largest_free: 39109
      fragments: 1
      compactions: 0

      --
      Dr Jon D Harrop, Flying Frog Consultancy Ltd.
      The OCaml Journal
      http://www.ffconsultancy.com/products/ocaml_journal/?e
    • Joel Reymont
      So how do you figure out what conses in your program? Consing by function is very much what I m looking for. Thanks, Joel ... -- http://topdog.cc -
      Message 2 of 4 , Jul 4, 2007
      • 0 Attachment
        So how do you figure out what conses in your program?

        Consing by function is very much what I'm looking for.

        Thanks, Joel

        On Jul 4, 2007, at 11:04 AM, Jon Harrop wrote:

        > It doesn't give you a breakdown of allocation by each function, as
        > gprof gives
        > a breakdown of time spent in each function, but you can get some
        > simple
        > statistics of overall allocation and collection statistics with
        > Gc.print_stat:
        >
        --
        http://topdog.cc - EasyLanguage to C# compiler
        http://wagerlabs.com - Blog
      • Jon Harrop
        ... With difficulty. Are you seeing large amounts of time spent in the GC but you can t tell which functions are allocating the data that the GC is dawdling
        Message 3 of 4 , Jul 4, 2007
        • 0 Attachment
          On Wednesday 04 July 2007 11:17:18 Joel Reymont wrote:
          > So how do you figure out what conses in your program?

          With difficulty. Are you seeing large amounts of time spent in the GC but you
          can't tell which functions are allocating the data that the GC is dawdling
          on?

          > Consing by function is very much what I'm looking for.

          Maybe there is some way of logging consing information automatically using
          camlp4...

          --
          Dr Jon D Harrop, Flying Frog Consultancy Ltd.
          The OCaml Journal
          http://www.ffconsultancy.com/products/ocaml_journal/?e
        Your message has been successfully submitted and would be delivered to recipients shortly.