Skip to content

Investigate memory problem while running unit tests linked with Emscripten #249

Closed

Description

@dsuponitskiy
  1. Link OpenFHE with Emscripten and -DNATIVE_SIZE=64
  2. Run node ./unittest/pke_tests.js on a Ubuntu machine with 16GB or 32GB RAM

Unittests in src/pke/unittest/utckksrns/UnitTestCKKSrns.cpp (EVAL_FAST_ROTATION_41 and all others after it) and src/pke/unittest/utckksrns/UnitTestCKKSrnsSerialize.cpp (CONTEXT_WITH_SERTYPE) fail because of lack of memory. Example:
"Exception thrown from UnitTest_EvalFastRotation(): std::bad_alloc" for EVAL_FAST_ROTATION_41.

It is most likely because of the cryptocontext memory not cleared after the previous test cases (could be cryptocontext's static data members).

Activity

  1. added this to the Future Releases milestone on Nov 30, 2022
  2. self-assigned this
    on Nov 30, 2022
  3. modified the milestones: Release 1.1.2, on Nov 8, 2023
  4. modified the milestones: , Future Releases on Nov 12, 2024
  5. BAder82t commented on Jun 18, 2026

    @BAder82t
    Collaborator

    Added pr, wires the #1179 cache-clear helpers into ReleaseAllContexts so live contexts actually get cleared, and adds a trim path so freed memory returns to the OS.

    This lets the EVAL_FAST_ROTATION_41–48 and CONTEXT_WITH_SERTYPE tests #985 had to disable run again under Emscripten without hitting the 4 GB WASM cap, closes #249. No hot-path file touched.

  6. added a commit that references this issue on Jul 8, 2026
  7. added a commit that references this issue on Sep 4, 2026
  8. added 2 commits that reference this issue on Sep 9, 2026
  9. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions