Home > Community > Forums > Custom IC SKILL > how to delete variable or clear the workspace

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 how to delete variable or clear the workspace 

Last post Tue, Mar 13 2012 3:58 AM by Andrew Beckett. 3 replies.
Started by imagesensor123 13 Mar 2012 03:07 AM. Topic has 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Mar 13 2012 3:07 AM

    how to delete variable or clear the workspace Reply

    Hi,

       could we delete some variable during the skill session, or i would like to clear my defined user workspace(mainly contain the variables) in order to save the memory. for example, i have built a form with a lot of variables, and i want to delete them after closing my window(stand window in cadence), do you have some experience to share with me. 

     

    Regards, zfeng
    • Post Points: 20
  • Tue, Mar 13 2012 3:16 AM

    • naavika
    • Not Ranked
    • Joined on Mon, Mar 12 2012
    • Hubli, Karnataka
    • Posts 4
    • Points 65
    Re: how to delete variable or clear the workspace Reply

    imagesensor123,

    Are you associating the variables with the windows? Or are they just global?

    If they are global,

    you can make them undefined by declaring them as unbound.

    If list_variable is a variable you have declared and now want to delete it,

    delete the same by declaring it as unbound.

    list_variable=`unbound;

    Hope that was helpful

    • Post Points: 20
  • Tue, Mar 13 2012 3:52 AM

    Re: how to delete variable or clear the workspace Reply

    Hi naavika,

        thanks for your replying, i define some variable which is used to store some data, such as "matrix" or "form" with some fields, i try to delete them, i think they are global variables, do you mean that i can clear the memory by using the "unbound" function?  

    Regards, zfeng
    • Post Points: 20
  • Tue, Mar 13 2012 3:58 AM

    Re: how to delete variable or clear the workspace Reply

    SKILL will garbage collect memory when it needs to. If you have objects which are no longer referred to, these are available for garbage collection - usually before it tries to allocate any more space for a particular type of object. Note that this doesn't necessarily mean that the footprint of the virtuoso process will decrease, but it should re-use memory where it can.

    It's not necessary to set it to 'unbound for this to happen - any time the data is no longer referenced, it can be reclaimed (so setting the variable to nil would have the same effect). The difference is that setting it to unbound makes it appear as if the variable doesn't exist, so if you try to refer to the variable again later, you'll get an  "undefined variable" error message.

    Note you can force garbage collection by calling gc() (after removing references to the data of course), but it's not normally necessary to explicitly call the garbage collector yourself.

    Regards

    Andrew.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by imagesensor123 at 13 Mar 2012 03:07 AM. Topic has 3 replies.