openfhe-development
openfhe-development copied to clipboard
Investigate memory problem while running unit tests linked with Emscripten
- Link OpenFHE with Emscripten and -DNATIVE_SIZE=64
- 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).