To develop Google AppEngine web application, I normally test in the development server by using "mvn appengine:devserver". Whenever browsing localhost, the application shows OutofMemoryError as following. It may be the local_db.bin size is quite large than 1G memory as default in Google AppEngine development server. By using Eclipse Debug Configuration, it is available to increase the application's default memory size as follows. With these arguments, it works fine. The main development environment is a terminal, not Eclipse. Regard to this, can I have any solution to increase the memory size of the default devserver command in Google AppEngine Java SDK.
Exception in thread "Scanner-0" java.lang.OutOfMemoryError: Java heap space
[INFO] at java.io.WinNTFileSystem.list(Native Method)
[INFO] at java.io.File.list(File.java:1122)
[INFO] at java.io.File.listFiles(File.java:1207)
[INFO] at org.eclipse.jetty.util.Scanner.scanFile(Scanner.java:576)
[INFO] at org.eclipse.jetty.util.Scanner.scanFile(Scanner.java:580)
[INFO] at org.eclipse.jetty.util.Scanner.scanFile(Scanner.java:580)
[INFO] at org.eclipse.jetty.util.Scanner.scanFiles(Scanner.java:432)
[INFO] at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)
[INFO] at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
[INFO] at java.util.TimerThread.mainLoop(Timer.java:555)
[INFO] at java.util.TimerThread.run(Timer.java:505)
[Eclipse Debug Configuration]
[Program Argument]
--allow_remote_shutdown --disable_update_check --no_java_agent D:\xxx
[VM arguments]
-Xms2048m -Xmx8182m -Duse_jetty9_runtime=true -D--enable_all_permissions=true -Ddatastore.backing_store=D:\ocal_db.bin'
Thanks in Advance,
You can customize the JVM options using the
jvmFlags
parameters as per this documentation.If you include in the pom.xml it will look like this:
There was a discussion on this, you can take a look in this answer