Skip to content

Modify heap size or allow heap growth #29

Closed
@emmatyping

Description

@emmatyping

When running

help('modules')

it causes Python to OOM (the heap is limited to 16MB). We should consider using either

  1. -s INITIAL_MEMORY=X for something like 20-30MB or
  2. just allow memory growth via -s ALLOW_MEMORY_GROWTH=1.

We should maybe also compile with -s ABORTING_MALLOC=0 which makes malloc() return NULL, which will give people a more familiar Python traceback rather than the following:

Uncaught RuntimeError: Aborted(Cannot enlarge memory arrays to size 16855040 bytes (OOM). Either (1) compile with  -s INITIAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions