Is Julia the right tool for the job?

No it isn’t. Try GC.gc(false)