I don't have R installed here, so I'm using dummy definitions for RNORM and RGAMMA. (Note also that your CFFI definitions are in the wrong package -- unless you're missing an assumed IN-PACKAGE :CL-RMATH there.)
(declaim (inline rnorm rgamma))
(defun rnorm (x y)
(declare (double-float x y))
(* x y))
(defun rgamma (x y)
(declare (double-float x y))
(+ x y))
Given these, and running
(loop repeat 100
do (gibbs 10000 1000)
(room) (write-line "---"))
(write-line "--- After full GC ---")
(gc :full t)
(room)
I could not reproduce your symptoms so far.
Can you reproduce your symptoms without using CL-RMATH? If so, please provide a full terminal (not Slime) session transcript.
I don't have R installed here, so I'm using dummy definitions for RNORM and RGAMMA. (Note also that your CFFI definitions are in the wrong package -- unless you're missing an assumed IN-PACKAGE :CL-RMATH there.)
(declaim (inline rnorm rgamma))
(defun rnorm (x y)
(declare (double-float x y))
(* x y))
(defun rgamma (x y)
(declare (double-float x y))
(+ x y))
Given these, and running
(loop repeat 100
(write- line "---"))
do (gibbs 10000 1000)
(room)
(write-line "--- After full GC ---")
(gc :full t)
(room)
I could not reproduce your symptoms so far.
Can you reproduce your symptoms without using CL-RMATH? If so, please provide a full terminal (not Slime) session transcript.