The BlackBerry® Java® Plug-in for Eclipse® and the BlackBerry® Java® Development Environment can potentially run out of memory when attaching to BlackBerry smartphones or simulators, particularly newer ones. If you encounter this error, you must increase the heap size of the Java Virtual Machine (JVM) using the –Xmx flag with a larger amount of memory. For example, -Xmx1024M. You can do this by adding an argument to your Eclipse® shortcut, modifying Eclipse.ini or, modifying the batch file used to invoke the BlackBerry JDE.
BlackBerry Java Plug-in for Eclipse:
To give the JVM more heap space in Eclipse, pass the following argument to Eclipse when it is launched:
-vmargs –Xmx1024M
To pass the argument to Eclipse, complete the following tasks:
For example, "C:\Program Files\Eclipse\eclipse.exe" -vmargs -Xmx1024M
You can also modify the Eclipse.ini file, found in Eclipse’s main directory, by adding the –Xmx flag there. For more information on modifying the Eclipse.ini file, search http://wiki.eclipse.org/ for terms such as “How do I increase the heap size available to Eclipse?”
BlackBerry Java Development Environment:
To modify the BlackBerry JDE 5.0 complete the following steps:
1.) Select Start > Research In Motion > BlackBerry JDE 5.0.
2.) Right click the JDE and select Edit. This should open an instance of Notepad with the following entry: start javaw -Xmx256M -DRIM_RUNTIME=..\lib -DRIM_BIN=..\bin -jar IDE.jar
3.) Modify the entry to the following: start javaw -Xmx1024M -DRIM_RUNTIME=..\lib -DRIM_BIN=..\bin -jar IDE.jar
4.) Save the file.
To modify a different BlackBerry JDE, change that batch file instead. The important part is to add or change the –Xmx argument to a larger value, such as -Xmx1024M (which will give the JVM 1024MB of stack space).