It's running out of memory because of your 10s of thousands of links. You probably need more memory - a lot more memory.
There's a small chance that there is some memory leak associated with the file, but you'd need to submit a bug the bug tracker for that to be investigated:
https://bugs.launchpad.net/calibre