C struct garbage collection not run frequently enough

Note that GC.gc() is distinct from GC.gc(false); the former runs GC manually while the latter disables it entirely (after performing a collection, I believe).

You haven’t mentioned a slowdown so far - if it’s getting slower because of that, that’s of course worth looking into. I suspect that any slowdown that does occur because of this (in your particular case) would be explained by having the OS swap out to disk? That’s something you’ll have to investigate though.

Generally, Julia tries to run GC not that often, because empty memory is (more or less) “free real estate”. Garbage collection runs are relatively slow and getting new memory is relatively quick. In recent versions (I don’t know the exact one OTOH, sorry) you can give --heap-size-hint to force GC to occur once a threshold is reached, which might be beneficial in your case.