I tend to do something in between. When I feel like I've really gotten to know a piece, I keep the music open on the piano, but I don't refer to it unless I get stuck.
Real memorization -- not using the music at all -- is a whole different thing, can be very scary, and requires a different approach, in my experience. My last teacher had some good tricks for that: break up the piece into sections, number the sections, and then be able to play starting at any section. So she would say "Section 7 -- Section 3 -- Section 2" and I would have to play them in that order. This is a great help if you get one of those blankouts during performance.
Incidentally, I went to a concert recently by an older pianist, very well regarded where I live, who of course played everything without the music. He had no trouble with some rather difficult Chopin and Schumann pieces, but when he got to a Mozart sonata that he's probably been playing for 50 years, he messed up royally. He got into the recapitulation and then started playing the exposition instead, then realized what he'd done and tried to improvise to get back into the right key. Everybody was so embarrassed for him, and all I could think was "Dude! Keep the music on the piano! Nobody will mind if you take a peek if you get lost."