[Openmcl-devel] Tracking down a memory leak

Shannon Spires svs at bearlanding.com
Sun May 30 19:09:27 PDT 2021


These might be helpful.

(ccl::heap-utilization)
(ccl::heap-utilization :classes t)

(defun count-instances-in-heap (class)
   "Returns the number of instances of class in heap."
   (when (symbolp class) (setf class (find-class class)))
   (let* ((count 0)
          (filter #'(lambda (obj)
                      (when (eql (class-of obj) class)
                        (incf count)))))
     (declare (dynamic-extent filter))
     (ccl::%map-areas filter)
     count))

(count-instances-in-heap 'foo)


On 5/30/21 7:21 PM, Ron Garret wrote:
> I have a long-running process that is slowly leaking memory over a period of days.  I’ve tried tracking it down by intentionally running parts of the code in tight loops to see what makes the heap grow but no luck.  AFAICT, all the code is well-behaved, and yet the memory image keeps growing inexorably so that I have to restart the process every couple of days.  Does anyone have any ideas on how to track this down?  Does the CCL GC have any secret internal diagnostics that might help?
>
> Thanks,
> rg
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list