What causes Ruby memory bloat?

What causes Ruby memory bloat?

Both Ruby heap pages, and any external data, are allocated using the system’s memory allocator. The memory allocator then assigns pieces of an OS heap to its own callers, until there is no more free space, in which case the memory allocator allocates a new OS heap from the kernel. If an entire Ruby heap page ends up consisting only of free slots, then that entire Ruby heap page can be freed back to the memory allocator (and potentially back to the kernel).

Source: www.joyfulbikeshedding.com