Home > Community > Forums > Custom IC SKILL > makeTable memory usage

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: *

 makeTable memory usage 

Last post Fri, Feb 6 2009 9:54 AM by Austin CAD Guy. 2 replies.
Started by ahamlett 08 Jan 2009 11:07 AM. Topic has 2 replies and 1683 views
Page 1 of 1 (3 items)
Sort Posts:
  • Thu, Jan 8 2009 11:07 AM

    • ahamlett
    • Top 500 Contributor
    • Joined on Wed, Jul 16 2008
    • Dallas, TX
    • Posts 31
    • Points 585
    makeTable memory usage Reply

    Is there a way to release the memory used by the makeTable() function? If you assign nil to the variable holding the table object, will the table be deleted and the memory freed?

    I would like to use makeTable in a pcell, however I'm worried about using too much memory if the table data is always around and duplicated wherever the pcell is used.

    I could use remove(g_key o_table) on every element.

    • Post Points: 20
  • Thu, Jan 8 2009 11:32 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,595
    • Points 16,045
    Re: makeTable memory usage Reply

    Hi there,

    You may be aware that garbage collection is the process by which unused memory is reclaimed.  There are various ways that memory can become unused, for example, it was allocated in a let statement and this block of code has been executed and exited, or as you state, by effectively removing references to the memory.  Once all references to a chunk of memory have been removed, it is liable for garbage collection.  This process occurs every so often, but can be initiated by the user also, using the gc() function. See the following section in the SKILL Language User Guide in SourceLink:  "Memory Management (Garbage Collection)"

    I would recommend using an encapsulation technique when writing your PCell code, so that the code that does all of the work is encapsulated in a procedure which can be debugged outside of the PCell development, and also potentially re-used by other PCells. Something like the following:

      pcDefinePCell(
       list( ddGetObj("libName") "cellName" "layout")
       (
        ( paramA 1.0 )
        ( paramB 2.0 )
       )
       myPCellTopFunction( pcCellView paramA paramB )
      )
    

     Hopefully the above information and pointers will help you.

    Best regards,

    Lawrence.

    • Post Points: 20
  • Fri, Feb 6 2009 9:54 AM

    Re: makeTable memory usage Reply

     Also be aware that when you pass a table as an argument, you are passing a pointer to the table and not the values in it. So if you change a value in the table inside a program where it came in as an argument, you change the table itself.

    HOWEVER- It is much faster and takes less memory to pass the table as an argument than to pass the very large list of individual arguments. If your table variable is defined in a let statement, it will be garbage collected when it finally goes out of scope.

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by ahamlett at 08 Jan 2009 11:07 AM. Topic has 2 replies.