By default, Studio uses only 768 Mb of memory and cannot allocate more if you do not configure this value. If you are working on a big project with a lot of dependencies you may need to increase default sandbox memory available for Studio.
In order to customize available memory use the following steps: