Malcolm III was said to have built his tower around the time he married Margaret Aetheling, c.1070.  You can still see its remains today when you walk from the famous Abbey (where Robert the Bruce is buried) through Pittencrieff Park and up to Tower Hill.

The tower measured about 48’x52′ and was thought to have had two stories and perhaps 20 small rooms plus servants quarters.  It was already perched about 70′ on a hill above a little stream, and may have been accessed by a drawbridge, which would have made it pretty well fortified.  Here is a 1790 engraving drawn by Mr. John Baine, Civil Engineer, Edinburgh:

Composition View of Malcolm Canmore’s Tower

Incidentally, the Pittencrieff estate was purchased and donated to the town of Dunfermline by Andrew Carnegie, who was born there in 1835.  Thanks to Carnegie, everyone can enjoy the park and castle ruins that were closed to the public when he was a child.