I have the following code working, collecting garbage correctly but too lazily for my needs:
(define dispose-pointer (get-ffi-obj "aztec_dispose_pointer" lib (_fun _pointer -> _void))) (define _load-series (get-ffi-obj "aztec_load" lib (_fun _string -> _pointer))) (struct Series (s phantom)) (define (load-series id) (define ptr (_load-series id)) (unless ptr (raise-user-error (format "failed to load ~a" id))) (register-finalizer ptr dispose-pointer) (Series ptr (make-phantom-bytes 2000000))) The problem is that memory grows wildly, making the program inappropriate for our system. If I call (collect-garbage), it collects fine. My attempt to increase the aggressiveness of GC was via the make-phantom-bytes. I see no empirical difference that the phantom bytes make a difference. The real object size is about 80K. Whether 80K or 100 megs, I observe no difference in memory consumption. Hopefully, I'm misunderstanding the meaning of phantom-bytes, an entity that I understand as existing to hint about external memory allocation taking place that otherwise would be unknown to the collector. Thanks, JG -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.