Note the presence of camlFoo_1 and camlFoo_2. Only the second one is actually used.

This comes from Closure.close_functions, which tries to compile first the functions under the assumption that their environment is not used, and do it again if this assumption is invalidated. Since structured constants are now allocated during this pass, they can be allocated several times.

One possible fix is to backtrack the list of allocated structured constants when a second pass is required.

Note that even if the sharing of constants is added (0005779), this will still apply because of string literals (which won't be shared, since they are mutable).