When I started Mac programming in 1985, all I needed was K&R C, a 680000 assembly language manual and the three loose-leaf binders of Inside Macintosh. For those who started in Pascal all you needed was in the binders.
Of course you can't; unless you are a freak of nature a brain can only hold so many details in its working memory. These days it's imperative that you learn to work with lots of online (and offline if you still like books) reference material. I call it "just in time information" - all you have to remember is where the information is stored, and have a clear understanding of how to absorb, learn and apply the information to your problem.
And then you forget it again. That's not Alzheimer's, it's the only way to work today without becoming narrowly specialized. In 1985 I could remember virtually everything I needed during a day's coding. Today, I continuously juggle references to supplant the working knowledge I have from my current project. Switching from language to language and framework to framework it's tough sometimes to keep things straight so even language syntax is sometimes a mystery ("do I need semicolons here?").
Today you can actually do this kind of mental juggling, since virtually all documents are online or searchable, unlike the early days of paper and books. Brains are not really all that well designed for multitasking, but with the aid of easy to find information, you can manage it. The basics of programming are the root knowledge and (mostly) are applicable to every kind of coding task.
Sadly being this type of multi-environment coder is not very conducive to job interviews, where often people who focus on only a few technologies expect you to have the precise memorization that they have. I'm sorry, I can't remember the home interface of an EJB2.X Entity bean that I haven't touched in years.
It's hard to convince people that your knowledge is merely an extension of the documentation, with added experience from years of switching from technology to technology. I'm only a master of what I worked on this week. Something I haven't looked at in a couple years is a distant memory; yet given the requirement to learn it again it takes almost no time to remaster. Learning something completely new isn't hard either since I have so much experience learning something new and delivering projects in it. Of course it's a tough sell; people find specialists easier to identify.
The only alternatives are to memorize as little as possible and extend your brain with references; or wait until one can plug in memory chips into your brain.