Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#9 mem leak of slatec func

critical
closed-fixed
None
5
2001-03-31
2000-10-10
Frank Schmauder
No

It seems to me there is a memory problem in one of the SLATEC
routines. If the following code is submitted RAM goes up.
###################
use PDL;
use PDL::Slatec;
$field = sequence (3,3,800);
while (1) {
&calc;
}
sub calc {
@allev_inert = eigsys( $field );
}
###############################
I suppose the trouble is connected to the way PP interfaces the fortran
subroutines.

Best regards,
Frank

Discussion

  • Doug Burke
    Doug Burke
    2000-12-13

    Actually, the leak seems to be due to the long(pdl(1)) in the call to rs(). Following the
    code leads me to suspect the memory loss is
    caused by a call to sever() in convert(). As an
    example:

    use PDL; use PDL::Types; $a = pdl(1);
    while (1) { $b=$a->copy;
    $b->flowconvert($PDL_F); }

    does not leak memory, but if I change the last line to $b->flowconvert($PDL_F)->sever(); it does.

     
    • assigned_to: nobody --> csopen
     
    • milestone: 100100 --> critical
    • status: open --> open-fixed
     
  • Work around that keeps convert from loosing memory is now in CVS.
    This should fix the originally reported slatec leak (please test).

    However, the heart of the problem lies in the core (see pdlapi.c and comments in pdl_make_physical). Final solution will require looking into meaning of the various state flags of piddles. Other functions might be also affected by this bug.

    Basically, redodims is called incorrectly twice for the same piddle (from make_physdims and make_physical) thereby calling initthreadstruct twice and allocating memory for thread struct twice but freeing eventually only once!

     
    • status: open-fixed --> closed-fixed
     
  • Logged In: YES
    user_id=1120

    leak seems to be plugged now (CVS). Also fixes the reported
    problems with C<index>. Still no completely satisfactory
    patch but good enough for government work. For details check
    pdlapi.c and pdlthread.c + comments in Changes. Closing
    bug....