I am having the same problem. I have a set of 76 points and I want to build a network of least cost paths between them. I created 76 pairs of distance accumulation and back direction rasters (planar distance method). Then I used the Optimal Path As Line tool with Path type = "Each cell" and Create network paths = TRUE.
For some pairs of rasters, the tool works fine, completing in about 30 seconds. For other pairs of rasters it runs for upwards of 20 minutes until it uses up all the memory and I get error 010005: unable to allocate memory. I tried using the deprecated Cost Path As Polyline tool and got the same result, making me think there is a problem with the rasters themselves.
Thank you for your help,
Eli