_JAVA_OPTIONS environment variable with value -Xmx1g helped me...
Its working for me.
In Visual Studio, settings available in Properties - > Android Options -> Advanced -> Advanced Properties -> Java Max Heap Size. Set it to 1G.
Setting up Java Max Heap Size to 1G in ProjectName.Android-->Advanced Android Options worked for me
@arslanan resolved this problem. After the latest update of Xamarin, you should delete JAVA from Environment Variables.
This pc -> Properties -> Advanced System Settings ->Environment Variables -> (you will see java below system variables).
Using the Visual Studio Project Properties i set the size to 1G (1 Gigabyte) and it worked like a charm.
I changed heap size(1G) in android property and it's worked for me
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies