Memory Leak in LDV 4.1 and 5.1 when using Restart?

Discussion in 'Cadence' started by Chris, May 3, 2005.

  1. Chris

    Chris Guest

    I've noticed what appears to be a memory leak in LDV 4.1 and 5.1 running
    on both Linux and Solaris 32 bit machines. I'm not sure if this
    intentional, but it appears that everytime a restart is called from the
    tcl command interface, memory is not cleared. Consequently saving a
    checkpoint and restarting from this checkpoint several times (on the
    order of thousands) eventually leads to out of memory errors in the
    operating system. I've noticed if the simulation is exited and then
    restarted from the last saved checkpoint, the memory usage appears to be
    back to the original when the checkpoint was created. Anyone else run
    into this and have any more info on it? I realize that most users
    probably do not run this many restarts however it is necessary for my
    testing. I've attached a sample code.

    --Chris

    verilog file:
    -------------
    `timescale 1ns/1ns

    module test;
    integer a;
    initial begin
    a = 1;
    end
    always begin
    #1 a = a + 1;
    if (a == 10000) begin
    $display("A");
    end
    end
    endmodule


    sim.tcl file for save/restarting:
    ---------------------------------
    set LATENCY 1000

    # CREATE CHECKPOINT
    run -clean
    save -overwrite chkpt
    run $LATENCY ns

    # Loop continuously restarting from checkpoint each iteration
    while {1} {
    for {set j 0} {$j < 1000} {incr j} {
    restart chkpt
    run $LATENCY ns
    }
    set i [expr $i+1]
    puts [format "CHKPT %d" $i]
    puts [eval status]
    }
    finish


    SAMPLE OUTPUT (Notice the "data" increases with each 1000 restarts)
    -------------------------------------------------------------------
    CHKPT 1
    Memory Usage - 18.2M program + 2.8M data = 21.0M total
    CPU Usage - 0.8s system + 1.4s user = 2.2s total (70.4% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 2
    Memory Usage - 18.2M program + 3.1M data = 21.3M total
    CPU Usage - 1.4s system + 2.2s user = 3.6s total (69.7% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 3
    Memory Usage - 18.2M program + 3.5M data = 21.7M total
    CPU Usage - 2.1s system + 3.0s user = 5.1s total (68.1% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 4
    Memory Usage - 18.2M program + 3.9M data = 22.1M total
    CPU Usage - 2.8s system + 3.8s user = 6.6s total (68.3% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 5
    Memory Usage - 18.2M program + 4.3M data = 22.5M total
    CPU Usage - 3.5s system + 4.6s user = 8.0s total (67.3% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 6
    Memory Usage - 18.2M program + 4.7M data = 22.9M total
    CPU Usage - 4.1s system + 5.3s user = 9.5s total (67.5% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 7
    Memory Usage - 18.2M program + 5.1M data = 23.3M total
    CPU Usage - 4.8s system + 6.1s user = 10.9s total (67.6% cpu)
    Simulation Time - 1001 NS + 0

    CHKPT 8
    Memory Usage - 18.2M program + 5.5M data = 23.7M total
    CPU Usage - 5.5s system + 6.9s user = 12.4s total (67.0% cpu)
    Simulation Time - 1001 NS + 0
     
    Chris, May 3, 2005
    #1
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.