increasing_heap_memory.adoc 1.5 KB

123456789101112131415161718192021222324252627
  1. = Increasing Heap Memory in the jMonkeyEngine SDK
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :keywords: documentation, sdk, faq
  6. :relfileprefix: ../
  7. :imagesdir: ..
  8. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  9. If you've been working on a large scene in the SDK, there is a good chance that you will need to increase the size of Java's heap space (which is quite small by default). link:http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html[What is heap space?]
  10. To increase the amount of heap space allocated to the SDK, we must navigate to the SDK's installation directory and edit the etc/jmonkeyplatform.conf file.
  11. The installation directory for Mac and Windows is:
  12. *+++<abbr title="Operating System">OS</abbr>+++ X:* Applications/jmonkeyplatform.app/Contents/Resources/jmonkeyplatform/jmonkeyplatform
  13. *Windows:* C:\Program Files\jmonkeyplatform
  14. Tweaking the parameters to be right is quite a task because sometimes when specifing a too large value, the JRE might fall back to it's default value of (for example) 32 +++<abbr title="Megabyte">MB</abbr>+++. Also there are different values to increase. Take a look at your Error Message, it will show you whether you ran out of “Heap Space or “Direct Memory.
  15. In the config file you look for default_options=“.
  16. If you ran out of Heap Space increase the Value of -Xmx=512m to like 1024m or even further.
  17. If you ran out of Direct Memory, increase -XX:MaxDirectMemorySize=256M
  18. Note that Increasing the Heap Space might also fix problems where you ran out of DirectMemory.