I think you get you 'out of memory' errors because your file has no \n in it but your end of line is \n by default. So perl tries to eat the multi GB line and get the error.
A naive try is this:
perl -pe 'BEGIN { $/ = "RowwoR"; };s/RowwoR/\n/' <infile >outfile