Issue with viewer.model.setNodeMatrix(nodeId, result) on Root Node of Large Model

Hi everyone,

I’m encountering an issue when trying to run the following code:

try {
  await viewer.model.setNodeMatrix(nodeId, result);
} catch (error) {
  console.log('IafMathUtils.translateNode', error);
}

This works fine on smaller nodes, but when I attempt it on the root node of a large model, I receive the following error:

abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X 
with X higher than the current value 2147418112, 
(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 "). 
Build with -s ASSERTIONS=1 for more info.

:red_question_mark: Questions:

  • Is this related to WebAssembly memory limits? if so how to address?
  • Any other suggested workarounds when working with large models in a viewer?

Hello @raja.r,

Which version of Communicator are you using?

Thanks,
Tino

We’re currently on 2023 SP1

With the release of HC 2024.5.0, as noted in our release notes, we fixed an issue where memory usage increased significantly (which is similar to your situation):

If possible, please test on more recent version of Communicator.

Thanks,
Tino