Cannot Export Project If I include the Fenix 7 family of devices. Compiler error Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I am recieving an error when I attempt to export my project and it includes any of the fenix 7 family of devices this includes the 7, 7pro, 7s, 7x, 7xpro. The simulator starts up just fine with all of these devices and runs perfectly. The max or peak memory usage is 45-60/120 kb. I am not sure what I am missing. I have read around the forums and it was semi discussed and semi determined that the user had too many drawables. I have about 240 drawables in my project however I have reduced that to below 200 with no success. When I am compiling I am using 6.3.0, 6.2.2, and down to 4.2.4. 

I feel as though I am  missing something. Does anyone have any advice on what to do in this situation? All other devices the watchface will compile just fine. Any device I expect to fail I expect to fail in the simulator as well. For instance the Fenix 6 line of devices will fail with the same error in the simulator. But the fenix 7 family runs fine in the sim but will not compile.


Thank you

Auto

  • For future reference, there was "some" issue with my java installation. I did the following things

    1. I tried to modify my environment variables on windows by adding the flags  -Xms4g (which sets the initial heap size) in most places, and -Xmx4g (which sets the maximum heap size). These did not work and seemed to modify where my Java was identified on the path. VScode also started complaining that:

    The specified size exceeds the maximum representable size. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

    2. and when I tried to remove the flags it started giving me 

    Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap

    3. So I used the Ctrl Shift P command to "verify installation" which led to it saying "Cannot find Java on the path" So I tried to define it and set the path which I was unsuccsessful with.

    4. So I just went to my installations on windows and removed Java.

    5. Then I went to the latest version of java and selected a 64Bit edition which then installed and I was finally able to run my apps again. 

    6. I added the Fenix 7 devices back in and tried to export and IT COMPILED. 

    So the lessons learned here are ? I have no Idea. If you run into this just remove your Java and Reinstall the latest version with 64bit capability. 

    Thank you. 

    Auto 

  • Yeah, 32-bit Java is limited to a maximum heap size of 2 GB, and apparently Monkey C needs more than that. The export process seems super inefficient tho.