# loadSubtreeFromXmlBuffer reported an error

**URL:** <https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090>\
**Category:** HOOPS Visualize Web\
**Tags:** webviewer, how-to\
**Created:** [May 30, 2023, 3:18am UTC](https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090 "2023-05-30T03:18:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erduowang1995](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@erduowang1995](https://forum.techsoft3d.com/u/erduowang1995)\
**Post date:** [May 30, 2023, 3:18am UTC](https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090/1 "2023-05-30T03:18:57Z")

</div>

When I was in use loadSubtreeFromXmlBuffers, normal xmlString unable to load, has been an error, as shown  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/a/a66d8d627f9516355787ac2025bdc1dfb3139af7.png)

But the same xmlString can use loadSubtreeFromScsXmlBuffer loading, is this why?

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/guido/32/115_2.png) [@guido](https://forum.techsoft3d.com/u/guido)\
**Post date:** [May 30, 2023, 11:33am UTC](https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090/2 "2023-05-30T11:33:21Z")

</div>

SCS and SC loading (streaming) can’t be used at the same time in the same viewing session, so when the viewer is started in one mode (e.g. scs loading), then using the functions that work with streaming (without the “scs” in the name) will fail.

---

<div class="post-metadata">

**Author:** ![erduowang1995](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@erduowang1995](https://forum.techsoft3d.com/u/erduowang1995)\
**Post date:** [May 31, 2023, 5:17am UTC](https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090/3 "2023-05-31T05:17:32Z")

</div>

Ok, I’m using loadSubtreeFromScsXmlBuffer, big load model will give me prompt an error, then the model will not be able to operate, appear this kind of circumstance should be how to solve? I also tried in Communicator. WebViewerConfig configuration memoryLimit inside, but it still won’t do

Error message: 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

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/guido/32/115_2.png) [@guido](https://forum.techsoft3d.com/u/guido)\
**Post date:** [May 31, 2023, 11:39am UTC](https://forum.techsoft3d.com/t/loadsubtreefromxmlbuffer-reported-an-error/2090/4 "2023-05-31T11:39:53Z")

</div>

The memoryLimit only has an effect for SC streaming, so it won’t help with loading scs files. Unfortunately, if the content of the scs file is too large overall to fit into memory, there is not much you can do if you can’t switch to streaming, though you should look at my previous post [here](https://forum.techsoft3d.com/t/a-black-screen-appears-on-windows-when-the-model-exceeding-1-gb-is-loaded/1516/2) for some general tips & tricks.

Switching to SC streaming or even server-side rendering might be your best bet in this situation, if at all possible.
