...by using streams. This way we don't load all the blocks before parsing them. We parse them as we go.
bitcoind saves blocks in files called blk*****.dat. Those files can be piped into this example, which will parse them and spit out a nice looking string of all the blocks, which also includes parsed transactions.