title: How does one use SBCL's SB-SPROF allocation profiling?
body: <p><strong>Update: Upgrading to SBCL 1.0.24 fixed my problem.  (Though I also needed to upgrade SLIME to the 11-23-2008 revision.  The stable 2006-04-20 revision, as well as the head of CVS don't seem to work with SBCL 1.0.24.)</strong></p>
  
  <p>The <a href="http://www.sbcl.org/manual/Statistical-Profiler.html" rel="nofollow noreferrer">documentation</a> for the SBCL statistical profiler indicates that you can profile memory allocation in addition to CPU usage.  However, for the life of me, I have not been able to get it to profile more than a trivial Lisp form.  Here's an example of what happens:</p>
  
  <pre><code>CL-USER&gt; (require :sb-sprof)
  ("SB-SPROF")
  CL-USER&gt; (defun ! (n)
             (if (= n 1)
                 1
                 (* n (! (- n 1)))))
  !
  CL-USER&gt; (sb-sprof:with-profiling (:mode :alloc :loop nil :show-progress t :max-samples 100 :report :flat)
             (dotimes (n 100)
               (print n)
               (! 10)))
  ===&gt; 0 of 100 samples taken.
  
  0 
  1 
  2 
  3 
  4 
  Profiler sample vector full (12 traces / 1000 samples), doubling the size
  Profiler sample vector full (17 traces / 2000 samples), doubling the size
  Profiler sample vector full (25 traces / 4000 samples), doubling the size
  Profiler sample vector full (36 traces / 8000 samples), doubling the size
  Profiler sample vector full (52 traces / 16000 samples), doubling the size
  Profiler sample vector full (74 traces / 32000 samples), doubling the size
  </code></pre>
  
  <p>At this point, it usually hangs.</p>
  
  <p>Has anyone had success with this?</p>