externalized memory allocations in dl distance