If you delete layers in the Layers dialog box, then attempt to add or duplicate layers, you may see an "Out of Memory" message.
Deleted layers are not purged from memory until you click the OK button. This is necessary in order to allow you to click the Cancel button, thus canceling deletions and other changes made in Layers. If this happens, delete the layers, click OK, then reselect the Layers command and create or duplicate other Layers.