User Tag List

Results 1 to 5 of 5

Thread: Java Heap Space. Cannot Allocate more memory.

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)
    Mephistus's Avatar
    Join Date
    Jan 2008
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Java Heap Space. Cannot Allocate more memory.

    I'm having the java heap space problem when building my game in flash build.
    I didn't had that problem before, but I think as the game became bigger and bigger I can't export it as a whole anymore.
    on jvm.config, java.args is set like "java.args=-Xmx1024m"
    if I try to make it "-Xmx2048m" or anything bigger than that I get the following:
    Code:
    Error occurred during initialization of VM
    Could not reserve enough space for 2097152KB object heap
    My computer has enough memory for that, I think it might be a limitation on flash exporter or 32-bit java? What should I do? How can I export my game again?

    *EDIT*
    Fixed the issue!

    The problem was caused because Flash Exporter(which uses flex) only allows 32-bit Java(JRE/JDK), therefore, it can't reserve more than 1024mb heap space for building swf. Sometimes in a big flash game you need more memory to build than that.
    The fix was a workaround to make Flash exporter accept 64-bit Java JRE/JDK, so you can reserve more memory and build your big-ass flash app.

    If anyone wants the fix, I can provide. Just ask =)

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Jul 2020
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mephistus View Post
    I'm having the java heap space problem when building my game in flash build.
    I didn't had that problem before, but I think as the game became bigger and bigger I can't export it as a whole anymore.
    on jvm.config, java.args is set like "java.args=-Xmx1024m"
    if I try to make it "-Xmx2048m" or anything bigger than that I get the following:
    Code:
    Error occurred during initialization of VM
    Could not reserve enough space for 2097152KB object heap
    My computer has enough memory for that, I think it might be a limitation on flash exporter or 32-bit java? What should I do? How can I export my game again?

    *EDIT*
    Fixed the issue!

    The problem was caused because Flash Exporter(which uses flex) only allows 32-bit Java(JRE/JDK), therefore, it can't reserve more than 1024mb heap space for building swf. Sometimes in a big flash game you need more memory to build than that.
    The fix was a workaround to make Flash exporter accept 64-bit Java JRE/JDK, so you can reserve more memory and build your big-ass flash app.

    If anyone wants the fix, I can provide. Just ask =)
    Hey! How are you doing? I'm having the same issue but with the Android Exporter. How did you make the Flash exporter accept 64-bit Java JRE/JDK?

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleFirefly 3D Module
    tobydavis's Avatar
    Join Date
    Apr 2019
    Location
    United States
    Posts
    105
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ManuelGenaro01 View Post
    Hey! How are you doing? I'm having the same issue but with the Android Exporter. How did you make the Flash exporter accept 64-bit Java JRE/JDK?
    As far as I'm aware, you should be able to use a 64-bit Java JRE/JDK by going to Tools->Preferences and simply defining the path to it in the exporters section. While Fusion itself is 32-bit, I do not believe that stops it from using a 64-bit version of Java to compile for Android.

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,640
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by tobydavis View Post
    As far as I'm aware, you should be able to use a 64-bit Java JRE/JDK by going to Tools->Preferences and simply defining the path to it in the exporters section. While Fusion itself is 32-bit, I do not believe that stops it from using a 64-bit version of Java to compile for Android.
    I guess the problem was solved, given the date of the post you answered. :p For info the Android runtime now just needs the JDK installed by Android Studio in its own folder, you do not need to install any other JDK.

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleFirefly 3D Module
    tobydavis's Avatar
    Join Date
    Apr 2019
    Location
    United States
    Posts
    105
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    I guess the problem was solved, given the date of the post you answered. :p For info the Android runtime now just needs the JDK installed by Android Studio in its own folder, you do not need to install any other JDK.
    Thanks for the clarification Yves! I know this post is a bit old but I saw that no one answered Manuel's question about the Android exporter, so I figured that I'd leave an answer for anyone who may stumble across this thread with a similar question. Hope you are having a good day

Similar Threads

  1. Check free space in internal memory and sd card ?
    By EdwardF in forum Android Export Module 2.5
    Replies: 2
    Last Post: 3rd July 2014, 03:26 PM
  2. Java Heap Space Error
    By Hazard159 in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 10th May 2013, 06:03 AM
  3. [CRASH] Memory Object Runtime Crash with Allocate(
    By LB in forum Extension Development
    Replies: 8
    Last Post: 4th September 2011, 09:04 AM
  4. please correct java heap in next swf update
    By Drcooper in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 1st June 2011, 06:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •