• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Is it because of memory/gc issue?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 142
  • Views 1788
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it because of memory/gc issue?

archive
archive over 17 years ago

I have a skill code with about 5000 lines. Inside the top level procedure, everything is very simple: call two lower level functions (let's call them A and B). There is no global variables shared between function A and B except a cell view they will work on. So, I basically can run them step by step on a cell view if I like to do so.

I can't explain the following facts:
    (1).  if I run the top level procedure, which means that A and B will be run in sequence, then, it will take forever to finish the second function (B). (>24 hours). VERY SLOW!!  The function A takes about 1 minute cputime to run, which is ok.
    (2). Run A and B step by step:   run function A, which still takes about 1 minute. then, save the cell view and quite opus. restart opus and open the saved cell view. then, run function B on it, which takes about 5 minutes to finish, VERY FAST!!
    (3). Run A and B separately. After A finished, immediately start function B, both phenomena of item 1&2 may happen. Some times, I got B takes looong time (>24 hrs) and some times, I got B takes less than 5 minutes. If I interrupt the B function in the middle using "ctrl-C", and then, restart B, the chance is high that B will finish fast (

My goal is to run the top level procedure directly like in (1) in a reasonable short time.

I have used profile('memory) to look into the memory usage. function A will take ~300mB and B will take ~1GB. I added needNCells to increase the initial memory allocations in my code so that the allocated numbers are large than necessary values reported by profileSummary and gcsummary.  By the way, the computer I used has 6GB physical memory, much larger than the needed 1.5GB.

Also, I tried to insert "gc" in several locations of the code to force it collect garbage and tried to make sure all the used variables are local so that their memory can be recycled when a function is not used anymore.

But none of the above methods could help me reduce function B cputime if I run A&B together by calling the top level function.

What  have I missed? Please help!

Thanks,

Tong


Originally posted in cdnusers.org by tzhou@micron.com
  • Cancel
  • archive
    archive over 17 years ago

    Have you tried profiling the performance instead of the memory? If it is gc related, then the majority of the time will be indicated with the gc. The inconsistency in run time makes me think you have a variable that is not getting reset correctly or might be global and used by both routines. Have you run skill lint checker to look at global variables?

    -Derek


    Originally posted in cdnusers.org by dmay
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Does this SKILL code uses ipc and sleep calls? Is it anyway related to OSS based netlisting?


    Originally posted in cdnusers.org by rairaj
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi, Derek and Rairaj,

    Thanks for your reply!

    To Derek: when I tried profiling cputime or looked into the gcsummary report, the time taken by gc only tens of seconds. The huge time chunk is allocated to the function B. In function B, there are a lot of list operation (creation) and dbGetOverlaps. I guess the dynamic memory allocation is causing those procedures slow when A & B are run in sequence. I did pay attention to the variable types of function A (all of them defined withing let()), and actually, the reported memory usage of function A is not huge (300mb~500mb). I should have run lint as you suggested. So, I will do "lint" for the whole script (including function A&B) and post the result back later.

    To Rairaj: no ipc or sleep calls in the current script. This script is for processing a layout view, basically play with shapes. Therefore, no netlist involved.

    Tongju


    Originally posted in cdnusers.org by Tongju
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information