Memory Safe Computations with XLA Compiler