Randomly errors in pipelines

It happens randomly that in pipelines we get errors of the form

Another error comes from memory limitations.

With these errors large pipelines fail nearly every day. The questions is: can we do anything against it?