• 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. Under the hood memory management, w/o Garbage collection...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 1035
  • 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

Under the hood memory management, w/o Garbage collection.

liorscotland
liorscotland over 9 years ago

Hello all. Let us say that I have this (simplistic) code:
a=list( 1 2 3 4 5 6 7 8 )
a=car(a)
b=list(2 3 4)
The question is this: assuming that no "proper" garbage collection has been done. I.e., if the next command after b=list(1 2 3) will be gc(), memory footprint will change.
What happens is that a now takes far less space than it did in the past. Now b consumes more memory.
What will the SKILL engine do?

1. allocate more memory to contain variable b, and subsequent memory requiring
2. It will it use the memory release, after variable a needs less space, and garbage collection will simply relieve any excess memory?
My guess would be that  item 1 will happen.

Thanks.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi Lior,

    I'm not sure I entirely understand your question (or maybe the reason for the question). In general for each type, there is a "heap" of unused space which gets consumed as needed - so as new list cells are needed, it will eat into that unused space for list cells. When it runs out of these unused list cells, it will do a garbage collection to see if it can reclaim unreachable list cells and avoid having to allocate more memory. If there are none that can be reclaimed, it will allocate another chunk of list cells into the heap and start consuming those.

    In your example, the original list becomes unreachable and also all 8 list cells (assuming nothing else is referring to them) become "garbage". They might get re-used when b is created, but that depends on the available list cells in the heap (in practice the gc heuristics are a bit more complicated than I've described, but it's the general principle).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Hi Lior,

    I'm not sure I entirely understand your question (or maybe the reason for the question). In general for each type, there is a "heap" of unused space which gets consumed as needed - so as new list cells are needed, it will eat into that unused space for list cells. When it runs out of these unused list cells, it will do a garbage collection to see if it can reclaim unreachable list cells and avoid having to allocate more memory. If there are none that can be reclaimed, it will allocate another chunk of list cells into the heap and start consuming those.

    In your example, the original list becomes unreachable and also all 8 list cells (assuming nothing else is referring to them) become "garbage". They might get re-used when b is created, but that depends on the available list cells in the heap (in practice the gc heuristics are a bit more complicated than I've described, but it's the general principle).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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