Compute_log_likelihood RAM usage is huge

Does anyone have any pointers on this? Is this function expected to eat up so much RAM?
Is there another way of going about this?