CADAsset data cleanup

Hi,

When I load a new CADAsset in a scene, do I need to clean-up the data of the previous CADAsset?
If yes, how do I do it? If, no then how does the clean-up happen? I noticed that chrome.exe still shows high memory if previous CADAsset was a heavy one.

Thanks

  • Shailesh

Typically we would create a new CADAsset and load data into that. You can remove the previous asset from its parent.
else you can call:

cadAsset.removeAllChildren()

before loading more data into it.

Thanks Phil.

I have already done that in the code.

I did the following experiment:

  1. Load a heavy duty asset in the scene
  2. check the memory consumed by chrome (in task manager)
  3. load a lighter asset in the scene
  4. check the memory consumed by chrome, the memory does not decrease
  5. Load the heavy duty asset again in the scene
  6. check the memory consumed by chrome, the memory does not decrease. In fact it increases by the same amount as in step 1.

A repeated such steps keeps increasing the memory consumed by chrome.

How do I make sure that I free up the memory consumed by chrome?
Is it my code side problem?
Is it chrome side problem?
Is it zea engine side problem?

Regards,

  • Shailesh

I think this could be a memory leak.

Memory is only released if certain conditions are met. The browser will free up memory periodically when it runs Garbage Collection. We need to check if we are preventing GC from freeing memory by not following the rules correctly.

So this is a problem that we need to look at on our side.

We may have introduced a memory leak recently. I have logged the following issue in our engine repo to investigate.

Thanks for bringing this to our attention.

Thank you for taking the time to log this issue. After some investigation, we did in fact find a memory leak. Fortunately, this was quickly resolved and the fix should be included in our next release.

1 Like

Hi Phil,

Is this issue fixed? Is it part of a release? What is the version number?

Thanks & Regards,

  • Shailesh

Hi Shailesh, yes, the release 3.11.0 included the fix for the memory leak.

You can see the release notes here:
https://docs.zea.live/zea-engine/#/CHANGELOG