It seems the 'leak' was actually caused by my misunderstanding of the C free() function.
I thought freed memory was made available to the OS, and other processes, but it seems that it stays locked into the process who first allocated it (at least, on my computer, the system prefers crashing than retaking freed memory).