timob-14540: handle OutOfMemoryError gracefully