Of course, it's not the actual downloaded text that takes up all that memory. It's not like programs take up gobs of memory because the programmers were being lazy and disdainful.
No, it's the internal representation of the markup, and the program state of all of the javascript programs a page might incorporate, that takes up a lot of memory.