Well, you have two options that you can do. I'm not quite sure if there is actually another way in which you can free the memory, but to my knowledge here is what I think you can do.

1. Completely remove Photoshop from your computer, and just reinstall it again.
2. Just reformat your computer, and start up from new again.