Why does memory leak even when I release the HeapObject object obtained from swift_allocBox?

The SIL does not do the boxed allocation itself.

It calls builtins - autoDiffCreateLinearMapContext and autoDiffAllocateSubcontext, which perform the boxed allocation and return Builtin.RawPointers.

The SIL then performs initialization (using store) using these Builtin.RawPointers.