[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[Fwd: [Swig] memory leak with using blessed objects in Perl]



Hi, 

This is a post that I originally put on the SWIG developer's
mailing list. Apparently it had been mentioned on the p5p 
list, and a patch exists for it. Does anyone know where this
patch might be?

Thanks,

Dale Coder
-- 
                               .-|-.
Dale Coder                   .`  |  '.          phone: (408) 938-6403
PDF Solutions Inc.          /    |    \         cell:  (408) 506-6938
333 W San Carlos Ste 1200  /     |     \        fax:   (408) 280-7915
San Jose, CA 95110    ___.'PDF Solutions`.___   email: coder@pdf.com
---------------------------------+-----------------------------------

-- BEGIN included message

Dale Coder <coder@PDF.COM> said:
> 
> Has anyone ever seen this kind of problem before?
> 
> I've wrapped some C++ objects in Perl using SWIG, and
> I then I write a loop in Perl where I repeatedly call a
> another Perl subroutine. This subroutine just creates 
> and then immediately destroys a C++ object. 
> 
> I've noticed that the memory usage of this program grows linearly.

Yes we reported this as a Perl bug (certainly in 5.004.04) in this
and the p5p newsgroups some months ago.  It only appears with shadowed
objects.  We noted some bizarre effects, eg

    while (<>) {
        my $thing = Thing->new;
    }

leaks like a sieve, while


    while (1) {
        my $thing = Thing->new;
    }

doesn't.

One of the p5p gurus mailed me saying it was a bug in self-referential tie's,
and included an experimental fix, which I subsequently lost (sorry!).

You might want to pass it over the p5p list again.


Regards

Paul Breslaw.

-- END included message


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]