1. Open the Cofiguration dialog using “run->external tools configuration”.
  2. Open the JRE tab
  3. Click on “installed VM’s” button
  4. double click the active entry
  5. add “-Xms768m -Xmx1024m -XX:MaxPermSize=512m” to the field “Default VM Arguments”

if you still get out of memory errors try to set higher values in step 5.