when deleting a shape - get memory allocation failed

Discussion in 'Cadence' started by Marcel Preda, Jul 1, 2009.

  1. Marcel Preda

    Marcel Preda Guest

    Hi,



    I have a problem with a script which is creating some shapes in a
    loop,
    keep just few of them, delete the other shapes.

    Looks like when the shape is deleted, the memory is still allocated,
    and not reused.
    I get next warning message:
    ~~~~~~~~~~~~~~~~~~~~~~
    *WARNING* dbDeleteShape: A memory allocation for 2147483648 bytes
    failed.
    The process heap is 1130MB, and OpenAccess is using
    1068MB.
    The available system memory is 9710MB, and physical system memory is
    16026MB.
    ~~~~~~~~~~~~~

    So, I've create a simple test case: create and delte shpe inside of
    some big loops and nothing else.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /*
    Test dbDeleteObject(shape)
    Inside of two big loops, create shape and delete it iemdiatelly.
    After a while, the memory is exhausted.
    */
    let( (x y stepX stepY m cv
    shape)
    cv = cv
    ()
    x =
    0
    y =
    0
    stepX =
    10
    stepY =
    10
    m =
    4321

    for(i 1
    10000
    for(j 1
    10000
    shape = dbCreateRect(cv list("npoc") list(x:y (x+stepX):(y
    +stepY)))
    dbDeleteObject
    (shape)
    )
    println
    (i)
    x = modulo((x + stepX)
    m)
    y = modulo((y + stepY)
    m)
    )
    )
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    When i == 3355 , skill start to show the warning messages, and the
    shapes are not deleted.
    After a while also dbCreateRect() is failing.


    Is there a way to tell to icfb: "I do not need those objects any more,
    purge them from memory." ?

    ICFB version and others:
    ~~~~~~~~~~~~~~~~~~~~
    \o Program: @(#)$CDS: virtuoso version 6.1.3 05/25/2009 14:16
    (cic612lnx) $
    \o Sub version: sub-version IC6.1.3.500.11 (32-bit
    addresses)
    \o Host name (type): myhost
    (x86_64)
    \o Operating system: Linux 2.6.9-78.0.17.ELsmp #1 SMP
    ~~~~~~~~~~~~~~~~~~~~


    BR,
    Marcel
     
    Marcel Preda, Jul 1, 2009
    #1
  2. 1/ Are you using L/XL/GXL?

    2/ Could you try putting an hiUpdate() in your loop (say after the
    println)?

    3/ Could you give more information about why you want to do that?

    Yours,
     
    Jean-Marc Bourguet, Jul 1, 2009
    #2
  3. Marcel Preda

    Marcel Preda Guest

    Hi Jean-Marc,

    Answers
    1 - L

    2 - Just did it, same result

    3 little difficult to explain, but I'll try :)

    Let's I have two shapes s1 and s2 in my layout.
    I have to fracture s2 in tiny squares ~ 10x10 um, and keep only the
    squares which are on the edge of s2.
    *** Till now everything was fine. ****

    After that, for each tiny square I have to see which of them have
    direct visibility to s1.
    visibility == if I can draw a straight line from tiny_square to s1,
    without intersecting shapes of a certain layer.
    (for now I'm checking against bBox of s1, it's much simpler) .


    At this step, I try a ray scan approach.
    Because I did not found other solution I do like this:
    1)
    choose a point P on s1 perimeter, create shape sx = convex_hull(P,
    tiny_square) on some LayerX

    2)
    I do a dbLayerAndNot(cv list(sx) list_some_shapes newLayer),
    where list_some_shapes is a list with possible obstacles (they were
    get before)

    3)
    if dbLayerAndNot returns a single shape, that means there is
    visibility
    if dbLayerAndNot returns more than one single shape -> there is no
    visibility.

    4)
    delete shapes generated by dbLayerAndNot()

    5)
    if visibility, stop here
    if no visibility, choose a new point P1 and go with 1)
    P1 is a point on s1 perimeter, clock counter direction, at a distance
    of few um (now it's 5um) by initial P point

    I have to do all this stuff with s1 versus tens of shapes (depands by
    layout it can be from 10 to 50).

    Hope that makes some sense what I'm trying to do.

    Now I'm sure that this is not the best approach (it's also slow), and
    I have to change it.
    The idea is that there seems to be a problem in virtuoso
    interpreter :
    create and delete object will "eat" memory, and it is not reused - as
    I expected.


    BR,
    Marcel
     
    Marcel Preda, Jul 1, 2009
    #3
  4. [...]

    Well, the problem doesn't have the cause I had guessed. Another guess in
    the void (well, at least I won't guess about XL/GXL specific handling), try
    setting the undo limit to 0 with hiSetUndoLimit before launching your
    process which create and destroy lots of shapes; such kind of process are
    better handled by saving a check point and reverting to it if needed than
    by something designed for interactive undo.

    Yours,
     
    Jean-Marc Bourguet, Jul 1, 2009
    #4
  5. Marcel Preda

    Marcel Preda Guest

    Hi Jean-Marc,

    This hint did the job.
    Now i == 5800 and still counting :)
    Allocated memory till now to icfb is ~149MB.
    On previous version at i == 3355 it started to complain about memory.

    I had to look about how can I save a check point, and reverting back
    the state if needed - as you suggested.

    Thanks a lot,
    Marcel
     
    Marcel Preda, Jul 1, 2009
    #5
  6. I had nothing more fancy in mind than saving the CV (perhaps under a new
    name) and reopening it if needed. (see dbSave, dbCopyCellView, geSaveAs)

    Yours,
     
    Jean-Marc Bourguet, Jul 1, 2009
    #6
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.