env-make_global_ref adds a reference to the underlying Lisp_Object and allocates emacs_value from the global storage. env->free_global_ref on the other hand will only remove a reference to the underlying Lisp_Object and not free the emacs_value. Here is a simple recipe to reproduce the problem (I only tested this on linux). I'm attaching the necessary files. $ gcc -shared -fpic -std=c99 -I create_global_refs.c -o create_global_refs.so $ emacs --no-splash -q -l create_global_refs.so -l create_global_refs_test.el If you look at the memory usage of emacs (for example in htop) you'll see that with emacs-26 it is constant but with emacs-27 the resident memory quickly grows.