Brendan ZagaeskiUSForum Administrator, Xamarin Team Xamurai
Xamarin Studio 5.7 and Xamarin for Visual Studio 3.9 introduced a change in the "MaxPermSize" option that the Android designer uses when starting Java. The first sign that you're hitting this problem is a message in the Android designer:

Connection to the layout renderer failed. This may be be caused by a misconfiguration of Java.
Please close and open the file again.
Note that this message itself can have several underlying causes. To check if the workarounds will help in your particular case, you'll need to check in the log files [1] for the following error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine
(This error message might be broken up by other error messages.)
[1]: Log file locations
Visual Studio: %LOCALAPPDATA%\Xamarin\Log\devenv*.log
Xamarin Studio on Windows: %LOCALAPPDATA%\XamarinStudio-5.0\Logs
Xamarin Studio on Mac: $HOME/Library/Logs/XamarinStudio-5.0
Install Java JDK 1.8 (either 64-bit or 32-bit will work).
Create or update the "String Value" HKEY_CURRENT_USER\Software\Novell\Mono for Android\JavaSdkDirectory in the registry. Set it to the location of Java JDK 1.8. For example, for the default install path of the 32-bit JDK 1.8 on 64-bit Windows: C:\Program Files (x86)\Java\jdk1.8.0_31

(If you have Xamarin Studio 5.7 or higher installed, you can also modify this setting under "Tools -> Options -> SDK Locations -> Android -> Java SDK (JDK) -> Location". Visual Studio does not yet have a UI for adjusting this setting, but one will be added in a future release.)
Restart the IDE. The Android designer should now use Java 8, which does not use the "MaxPermSize" setting.
Note that this workaround will affect all Java processes on the system, so it might cause problems for other programs that use Java.
Create or update the _JAVA_OPTIONS environment variable so that it includes the string -XX:MaxPermSize=256m:

If 256 megabytes ("256m") does not stop the problem, you can experiment with adjusting the number down or up.
Restart the IDE.
If you see a different error message in the log files or no promising error messages at all, then a good next step would be to attach back your log files on an email to one of the support email addresses listed on https://store.xamarin.com/account/.
The candidate improvement for this issue will decrease the default "MaxPermSize" setting to a compromise between the new value and the old value that was used in Xamarin Studio 5.5.4 and Xamarin for Visual Studio 3.8. It will also provide a way for users to adjust the "MaxPermSize" setting in cases where the default setting does not work on their systems.
For reference, the corresponding bug tracking these upcoming changes is https://bugzilla.xamarin.com/show_bug.cgi?id=26026.
Posts
Duplicate threads (now closed to help consolidate further discussion on this thread):
Here we go again, another xamarin update and another problem. I've done all the steps (uninstalled, installed, set paths etc..) Open an axml file and it loads ok in portrait. Switch to Landscape and it crashes. I just see a blank error box but the log files says this..
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] ERROR: mono.android.DesignerException
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.DesignerSession.load(DesignerSession.java:175)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.DesignerSession.processMessage(DesignerSession.java:605)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.MessageListener.executeMessage(MessageListener.java:87)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.MessageListener$Runner.run(MessageListener.java:44)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at java.lang.Thread.run(Thread.java:745)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5]
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] mono.android.DesignerException
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.DesignerSession.load(DesignerSession.java:175)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.5] at mono.android.DesignerSession.processMessage(DesignerSession.java:605)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.6] at mono.android.MessageListener.executeMessage(MessageListener.java:87)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.6] at mono.android.MessageListener$Runner.run(MessageListener.java:44)
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2015-02-10 15:43:48.6] at java.lang.Thread.run(Thread.java:745)
Xamarin.VisualStudio.Shell.XamarinShellPackage Error: 0 : [2015-02-10 15:43:48.6] Session initialization failed
Xamarin.Designer.DesignerException: Exception of type 'Xamarin.Designer.DesignerException' was thrown.
at Xamarin.AndroidDesigner.JavaProcessConnection.GetResponse(BinaryMessage message, Int32 timeout)
at Xamarin.AndroidDesigner.JavaProcessConnection.SendMessage(BinaryMessage message)
at Xamarin.AndroidDesigner.AndroidRenderSession.InitSession(DesignerSessionParams refreshConfiguration)
Xamarin.VisualStudio.ProcessWrapper Verbose: 0 : [2015-02-10 15:43:48.6] -- Process Finished [-1] --
Here is some hopefully useful diagnostics for you. I think I see why it doesn't work in landscape. It worked in portrait on VS but crashed when switching to landscape. The device mode was set to Nexus 7.
When I opened same project in Xamarin Studio it crashed straight away in portrait. The device was set to Nexus 4.
I changed the device to Nexus 10 and I can switch to landscape and portrait without it crashing in both VS and XS. Looks like you have a bug somewhere related to this. Most of my controls are set to fill_parent and nothing appears to be set to overflow the right of the screen as it all resizes to fit. Single layout in a single file not landscape and portrait specific.
Hope this helps and we'll have a fix shortly.
Uninstall Java 7 and Java 7 development Kit , and install java 1.8
Worked finally... Thanks Brendan
Worked for me.. thanks Brendan!
Hello,
I've tried both switching to JDK 1.8 as well as setting the MaxPermSize variable, but am still getting this error. It occurs both in Visual Studio (2013 and 2015 preview) and Xamarin Studio v5.7.2 (build 7).
I recently installed the API 22 SDK. Not sure if that has anything to do with this. I've attached the list of packages that I currently have installed just in case that may be of some help.
@LeviBotelho, thanks for the report. In case you haven't already resolved this, a couple little ideas for next steps are:
You can double-check the error message that's appearing in the IDE log files (see the first post in the thread for a few more details). If those logs do not contain the error message "Could not reserve enough space for object heap", then the underlying problem is probably slightly different from the most common cause of the problem discussed in this thread.
You can experiment with adjusting 2 other
javamemory parameters (-Xmsand-Xmx) using some recently added per-project settings: https://kb.xamarin.com/customer/portal/articles/1897572-adjusting-java-memory-parameters-for-the-android-designer (if this link redirects to the top-levelhttp://kb.xamarin.com/page the first time you click it, try clicking it once more). Those per-project settings are a bit tricky to use, but they might help if you're still seeing some sort of error about reserving heap space or insufficient memory when using JDK 1.8 (because JDK 1.8 no longer needs the "MaxPermSize" setting).Thanks for the reply @BrendanZagaeski. Here is the log from Visual Studio. The problem doesn't appear to be linked to a memory issue, or at least not to the one mentioned in the other thread.
I have a similar message in Xamarin studio.
Any other ideas? I did upgrade to Java 1.8 after first encountering this error, so I doubt that the problem is with Java itself...
@BrendanZagaeski - One more symptom of this bug. In Visual Studio my .axml files appear to be locked, so I cannot edit them and save them in Source mode. This doesn't happen in Xamarin studio.
This is really frustrating as it completely prevents me from working on my layouts in VS... Any updates on this bug?
@LeviBotelho, you are correct: that looks like a different problem, not related to the memory settings.
It looks like the Android installation is unable to find the
com.android.utils.ILoggertype. On my system, that type is located in%ANDROID_HOME%\tools\lib\common.jar. Uninstalling and reinstalling the "Android SDK Tools" might help.If reinstalling does not help, we can discuss further either on a bug report (if this link redirects to the top level
https://kb.xamarin.comthe first time you click it, try clicking it once more) or on a new forum thread. In either case, please paste the version information plus the full error message (as in your comment from March 24) into the new report, and then reply back on this thread with a link to the new report. Thanks in advance.If you have a Business or Enterprise license, you are welcome to contact support for more rapid and thorough one-on-one help.
@BrendanZagaeski: Option 1 fixed the issue, thanks!
Option 1 worked for me, thanks!
Option 1 works for me, thanks!
Option 1 worked for me, thanks!
Per the problem in the screenshot, here are the three log files generated. Any help in resolving this issue is appreciated. I read thru all the posts and was unable to resolve the problem. I am using Windows 10, Xamarin Studio 5.10.1 (Build 6), Java 1.8.0_66 and jdk1.8.0_65.
My Development evnironment:
Windows7 + Visual Studio 2015 With Update2 + Xamarin 4.0.3.214 (0dd817c) + Xamarin.Android 6.0.3.5 (a94a03b)
**Workaround option 1: switch to Java JDK 1.8 solved issue for me ** with JDK 64 @ C:\Program Files\Java\jdk1.8.0_91 solved the issue for me
Uninstalling/Re-Installing the Android SDK tools worked for me! Thanks a lot
I am using Vs2015 and I simply can not get this to work. I have tried installing jdk8 and corrected the path and still no joy. I am raging.
It would appear to be combinations of Android SDK tools and Java sdk's. I had a setup working and then updated the version Android SDK tools and then I got the render error. Will try rolling back SDK tools.
I sense the MS kiss of death on this one.
Hello . I did all these things and still the message that
Unfortunately, the problem I've been having persists. It doesn't throw any error though, it just keeps loading infinitely...
I'm running on Windows 8.1 Pro, with the latest update and JDK 1.8. Since I don't get any output, I can't be sure of what the issue might be.
To clarify, when I open the layout, the designer view loads properly the first time around, but if I change something in the source and save it, it ceases to load properly. This problem is then propagated to any other layouts I might have open, or any new one I try to open, and the only solution to this is to restart Visual Studio.
Does loading problem produce an error message that includes "Could not reserve enough space for object heap?"
If not, then the issue is quite possibly something different. Note that this is quite an old forum thread. It is only relevant to problems where "Could not reserve enough space for object heap?" appears in the error message.
If the issue persists for you when using the 64-bit version of JDK 1.8 along with the latest Xamarin Cycle 8 Service Release 0 versions from the Beta updater channel, then please file a new bug report:
File a quick bug report
Be sure to include as many details as possible, including the log files from the IDE in this case. Thanks in advance!
@BrendanZagaeski
Something went wrong !
The Installed SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version.
Actions:
Open Android SDK
When I click on the Link , its not opening SDK, i tried from folder , from above toolbar link of SDK but its not working , tell me what to do ?
hi this is my error

please help me!!!
My probleme solved, Desabled firewall
Log
Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:5037
hi there
im have a same problem and i only install jdk version 8 and my problem solved.
hi there
im have a same problem and i only install jdk version 8 and my problem solved.