needNCells

Discussion in 'Cadence' started by Sa, Feb 25, 2004.

  1. Sa

    Sa Guest

    Hello,
    I am trying to figure out what excatly skill objects or skill cells
    mean in needncells function in cadence?
    all I want to do is to allocate like 50 MB of space to my association
    table in my skill code.
    any idea how to do it??
    I am doing this to avoid too many gc iterations ( found by gcsummary)
    that skill is doing.I thought if I preallocate memory to my assoc
    table, the gc number will reduce.
    thanks
    sampath
     
    Sa, Feb 25, 2004
    #1
  2. Sampath,

    I don't really see how needNCells is going to help if you have lots of garbage
    collection going on. It allocates more memory for a particular type, to stop
    it having to spend so much time allocating in smaller chunks.

    If it is garbage collecting a lot, it means that it is creating a lot of garbage
    - i..e creating lots of objects and throwing them away, and having to tidy up.
    You should run the profiler to find out where it is using memory and/or taking
    time and optimise the code.

    FYI, the argument to needNCells would be the type of the data you are
    storing in the table. It's the same as the objects listed in the gcsummary
    report.

    Andrew.
     
    Andrew Beckett, Feb 26, 2004
    #2
  3. Sa

    gennari Guest

    I remember how hard it was to build large association tables in an older
    version of Cadence that I used a few years ago. It would crash when the
    table was larger than 100,000 elements. I think the association table is
    much better in the newer releases of Cadence though. Still, if you're
    working with a table that large and you know the size then you should try to
    find a way to use a single array instead, and then that way you can
    allocate/'declare' it all at once. It may not be possible to use an array in
    your situation though. Either way, in order to avoid memory problems you
    should try to reuse as much storage and as many variables as possible.

    Frank
     
    gennari, Feb 27, 2004
    #3
  4. Sa

    Sa Guest

    Andrew, correct me if I am wrong,
    If I have a huge assoc table which contains lots of data..then
    initially skill will allocate some memory and when that memory gets
    filled up, it will allocate a new bigger chunk of memory for the table
    and copy the contents of the initial memory to this new memory and
    cleanup the initial memory using gc.
    So I thought if I allocate more memory initially then it will reduce
    number of gc iterations..
    I just want to make sure this is how skill works..
    Thanks
    Sampath
     
    Sa, Feb 27, 2004
    #4
  5. No, it doesn't really work like that, at least not in the IC5033 and later where
    the hash package had a major rewrite. Even before that I don't think it worked
    like that.

    For a start, the contents would be the same objects, and so those would not
    need to be reallocated. It's possible the has itself might need to be
    duplicated, but that's not going to be a major issue.

    The most likely cause of lots of gc is building lists and then discarding them.
    Are you doing lots of ~> operators, returning lists of database objects? Each
    time you do that, it builds a new list. If you don't keep the results, it will
    gc the generated list cells frequently.

    Andrew.
     
    Andrew Beckett, Feb 29, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...