note that the 345MB text only contains 635 lines. This might be the issue...
There's similar issue discussed here:
Tom did seem to accept that the attempted alloc is larger than it needs to be, but even if it were fixed you would still run into problems further down the line managing values of that size.
Geoff