Pooled memory for ndarrays