Adjusting Java memory parameters for the Android designer
- PDF for offline use
Let us know how you feel about this
Translation Quality
0/250
last updated: 2017-06
The default memory parameters that are used when starting the java
process for the Android designer might be incompatible with some system
configurations.
Starting with Xamarin Studio 5.7.2.7 and Xamarin for Visual Studio 3.9.344 these settings can be customized on a per-project basis.
New Android designer properties and corresponding Java options
The following property names correspond to the indicated java command-line option
AndroidDesignerJavaRendererMinMemory -Xms
AndroidDesignerJavaRendererMaxMemory -Xmx
AndroidDesignerJavaRendererPermSize -XX:MaxPermSize
Visual Studio
Open your solution in Visual Studio.
Select each Android project one-by-one in the Solution Explorer and click Show All Files twice on each project. You can skip projects that do not contain any
.axmllayout files. This step will ensure that each project directory contains a.csproj.userfile.Quit Visual Studio.
Locate the
.csproj.userfile for each of the projects from step 2.Edit each
.csproj.userfile in a text editor.Add any or all of the new Android designer memory properties within a
<PropertyGroup>element. You can use an existing<PropertyGroup>or create a new one. Here's a complete example.csproj.userfile that includes all 3 attributes set to their default values:<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectView>ProjectFiles</ProjectView> </PropertyGroup> <PropertyGroup> <AndroidDesignerJavaRendererMinMemory>128m</AndroidDesignerJavaRendererMinMemory> <AndroidDesignerJavaRendererMaxMemory>750m</AndroidDesignerJavaRendererMaxMemory> <AndroidDesignerJavaRendererPermSize>350m</AndroidDesignerJavaRendererPermSize> </PropertyGroup> </Project>Save and close all of the updated
.csproj.userfiles.Restart Visual Studio and reopen your solution.
Xamarin Studio
Open your solution in Xamarin Studio to ensure the solution directory contains a
.userprefsfile.Quit Xamarin Studio.
Locate the
.userprefsfile in the solution directory.Edit the
.userprefsfile in a text editor.Locate the existing XML element with the following format:
<MonoDevelop.Ide.ItemProperties.AndroidApplication1 ... >The last part of this element name will match the name of your project: "AndroidApplication1" in this example.
If the
<MonoDevelop.Ide.ItemProperties.AndroidApplication1 ... >element does not exist, create it anywhere within the enclosing<Properties>element. Be sure to replace "AndroidApplication1" with the name of your project.Add any or all of the new Android designer memory properties as attributes on the element. Here's a complete example
.userprefsfile that includes all 3 attributes set to their default values:<Properties StartupItem="AndroidApplication1\AndroidApplication1.csproj"> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Android.SelectDevice" /> <MonoDevelop.Ide.Workbench /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MonoDevelop.Ide.DebuggingService.PinnedWatches /> <MonoDevelop.Ide.ItemProperties.AndroidApplication1 AndroidDesignerJavaRendererMinMemory="128m" AndroidDesignerJavaRendererMaxMemory="750m" AndroidDesignerJavaRendererPermSize="350m" /> </Properties>Repeat steps 5-7 for each Android project in the solution that contains any
.axmllayout files. (That is, add one<MonoDevelop.Ide.ItemProperties.ProjectName>element for each project.)Save and close the
.userprefsfile.Restart Xamarin Studio and reopen your solution.
Let us know how you feel about this
Translation Quality
0/250
Xamarin Workbook
If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.

