This morning I have been experiencing an issue with Android Studio, whenever I open it I am getting the following error.
This happened to me when I entered /* to begin commenting out a few lines. And it happened before I could add the */ to close the comment section. Therefore, the entire second half of the file (and beyond) was being commented out. I could not go back to add the needed */ to close the comment, because the "Out of Memory" window kept popping back up before I could do so.
So I closed Android Studio, opened the same .java file in NotePad, added the needed * / a few lines below the /*, saved the file with NotePad, then reopened it again in Android Studio.
The Out of Memory problem was gone for good.