Android Studio 3.5 release notes:
Android Studio now notifies you if it detects that you could improve
performance by increasing the maximum amount of RAM that your OS should
allocate for Android Studio processes, such as the core IDE, Gradle daemon,
and Kotlin daemon. You can either accept the recommended settings by
clicking the action link in the notification, or you can adjust these
settings manually by selecting File > Settings (or Android Studio >
Preferences on macOS), and then finding the Memory Settings section under
Appearance & Behavior > System Settings.
From the android studio configuration page:
If you use a 64-bit system that has at least 5 GB of RAM, you can also adjust the heap sizes for your project manually.
It may be that your system does not meet these requirements.