?

Log in

No account? Create an account
perl leaks lame - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

perl leaks lame [Jun. 25th, 2004|02:19 am]
Brad Fitzpatrick
[Tags|, ]

Debugging leaks in Perl code sucks.

Perlbal recently, somewhere, is leaking ClientProxy objects. I keep track of when they're made, and when they're destroyed, and I know how many objects of each type are in memory at a time.... for ClientProxy it goes up and down, but mostly up. (all that infrastructure went in earlier when I worked with whitaker on tracing a prior Perlbal leak)

So now I know there's a leak, but hell if I can find it.

And all the leak detection modules out there either:

-- require -DDEBUGGING, not enabled on our production debian servers
-- require normal control flow (not event loop)
-- don't find references embedded in closures: $foo has member 'bar' which is sub { my $baz = \$foo; }

So basically it's just a lot of hunting and binary searching through changesets at this point.

YAY

want sleep

props to xb95 for joining me in pain, though.
LinkReply

Comments:
From: csnowx
2004-06-25 01:28 pm (UTC)
Is any of the recent work you've been doing contributing to the slow browsing of LJ?
(Reply) (Thread)
[User Picture]From: brad
2004-06-25 06:57 pm (UTC)
Die.

No.

To the contrary... I've been working non-stop to FIX problems due to general growth and over-utilization of our equipment.

Our internal network was saturated. That's now fixed, thanks to Semaphore guys.

Now we're maxing out a 100 Mbps line to the Internet. Need to get that fixed, but Internap moves so slow.
(Reply) (Parent) (Thread)
[User Picture]From: taral
2004-06-25 08:51 pm (UTC)
*scribbles this down as another reason why applications shouldn't be written in scripting languages*
(Reply) (Thread)
[User Picture]From: perlmonger
2004-06-26 03:00 am (UTC)
Ummm... In what way is Brad's problem down to Perl being a "scripting language" (whatever that might be)? Perl does have structural issues with memory leaks - the nested closure leak is my personal bugbear - but that's nothing to do with whether it, as a language, can be used for ad hoc scripting.

The quality of program design and the skills (and organisation) of the programmers are what ultimately determine application success, not the choice of language. Using a powerful, rich language with good OO facilities like Perl just makes the process faster, less error-prone, more maintainable and more fun.

[gets down of soapbox and crawls back into hole]
(Reply) (Parent) (Thread)
[User Picture]From: taral
2004-06-26 09:04 am (UTC)
Have you ever written an entire application in Haskell or ML?
(Reply) (Parent) (Thread)