I have a very large text file(45GB). Each line of the text file contains two space separated 64bit unsigned integers as shown below.
4624996948753406865 10214715013
I can only guess that the bottleneck is in:
string str(memblock);
-Because you allocate a 45MB long segment in memory.
You should read the file line by line, as described in here:
In order to profile your program, you can print clock() between each line, as described in: