For android studio 2.2 version VM option is not available directly from project structure.
steps to make gradle sync successful:->
1)OPEN project
2)Click on gradle script
3)open gradle.properties
4)Change org.gradle.jvmargs=-Xmx1536m to org.gradle.jvmargs=-Xmx1024m , lihat script dibawah ini :
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx1024m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
5)Save the work
6)Open File->Invalidate cache/Restart
And its done!!!
Enjoy Android!!!