EMSCRIPTEN Memory issue!

About Monkey 2 Forums Monkey 2 Programming Help EMSCRIPTEN Memory issue!

This topic contains 5 replies, has 3 voices, and was last updated by  APC 2 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5565

    APC
    Participant

    Hello Mark and Tony,

    After installing Emscripten I tried all the Pyro2 demos and the Gravity Zone does not run because of a memory issue. Java throws and exception. here is the error:

    Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 67108864, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0

     

    Gravity Zone works fine in the Desktop build.

    #5585

    Playniax
    Participant

    The Gravity Zone demo uses a rather large array map for the collisions so for Emscription you’ll need to increase the emscripten -S TOTAL_MEMORY setting in bin/env_windows.txt etc until it works.

    #5588

    Pakz
    Participant

    I have had this message to. Will try the setting. I thought it was broken.

    #5595

    APC
    Participant

    Tony

    I changed the -s TOTAL_MEMORY=100663297 in the env_windows.txt located here C:\Monkey2-v1.1.01\bin\ for both for C Compiler options and C++ Compiler options, But Monkey 2 is reading it from another env_windows.txt because it gave me the same error saying the TOTAL_MEMORY=67108864.

    I searched the entire C:\Monkey2-v1.1.01 directories and found only one env_windows.txt in the \bin directory.

    I did Rebuild Modules and Updated Module after I edited the env_windows.txt, I got the same error.

    #5600

    Playniax
    Participant

    It was Mark who gave me this advice a while back and it worked like a charm but haven’t tested this for a while so I will have a look at this myself and get back to you…

    #5605

    APC
    Participant

    Hello Tony I got it!

    Here is the change I made to bin/env_windows.txt

    ‘Linker options

    MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1

    Now it works fine!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.