Clear Memory During Script Run

Jeffersondhv
Jeffersondhv Altair Community Member
edited October 2020 in Community Q&A

Hello all,

 

I'm running a script in a very large assembly, where this script loops through every component retrieving a number of information for each of them.

The information I need is not that heavy, but it seems like HM saves in its memory much more data than what I'm requesting for each component.

Then it ends up crashing due to the lack of memory.

 

Is there any way to clear HM memory while a script is running?

 

Thank you

Answers

  • tinh
    tinh Altair Community Member
    edited March 2019

    Why do you think 'it seems like HM save...'?

    Pls show your script.

     

    Clear variable by unset

  • Jeffersondhv
    Jeffersondhv Altair Community Member
    edited March 2019

    Unfortunately I cannot post the script here.

    But basically it loops over every component to extract some mesh quality attributes.

    Functions like the following are used:

     

    *elementtestinterangle

    *elementtestlength

    hm_getthickness

    hm_getmass

     

    I say that it seems like HM is saving in memory more info than requested because the RAM runs out really quickly, but considering the output I'm requesting/getting, it's only creating a file with few KBs. And as the same variables are using during the loop, they should be getting overwritten, which would prevent running out of RAM. So my guess is that at each loop, each operation, HM is saving in RAM all the info related to that component, even info not requested, and as it loops through the components, the memory just keeps building up.

     

    I hope it helps clarify the situation.

    Thank you

  • tinh
    tinh Altair Community Member
    edited March 2019

    I just can say: something's wrong.

    Once you detect it, please let us know.

  • Jeffersondhv
    Jeffersondhv Altair Community Member
    edited March 2019

    Is there any tool that would help to identify the functions that are taking the memory or just the time to execute?

    Something like we have for Matlab, if possible.

  • tinh
    tinh Altair Community Member
    edited March 2019

    Use 

    time {script...}