Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: 5.6->5.8 Analysis

by grinder (Bishop)
on Jul 11, 2003 at 14:31 UTC ( [id://273376]=note: print w/replies, xml ) Need Help??


in reply to 5.6->5.8 Analysis

There's no magic program that will load another script and point out problems. The only approach will be to instrument you program and get it to report what it's doing.

Without knowing anything specific about your problem, I'd tend to point the finger at DBD::Oracle (if indeed that's what you're using) since it's the largest module you're using and has a healthy portion of XS code in it. Then again, a lot of people have pounded on it for years so the bugs should have been shaken out of it by now. Are you using version 1.14?

Are you using complex regexps (with the /x modifier and (?{...}) or some of the hairier extensions)?

Have you tried using Devel::Leak or Devel::LeakTrace? (you're going to need a perl compiled with -DDEBUGGING in this case).

Can you post any code? Is this 5.8.0 or 5.8.1-RC1?

_____________________________________________
Come to YAPC::Europe 2003 in Paris, 23-25 July 2003.

Replies are listed 'Best First'.
Re: Re: 5.6->5.8 Analysis
by doorslam (Beadle) on Jul 11, 2003 at 15:42 UTC

    Sorry, forgot to log on before posting my question.

    Perl is v5.8.0.
    DBD::Oracle::VERSION = '1.14'

    I'm mainly looking for something that will just scan the calls and print out a report, just so I have a list of candidates to narrow down my search as to what's broken, like:
    'open' behavior has changed, IO internals have been modified
    etc.

    pseudocode:

    open(INF,"<$filename") || die "Couldn't open in file\n"; my $id = 0; my $data = ""; ... my $statement = $dbh->prepare("insert into data_table values(:1,:2)"); while(<INF>) { if (s/^ID:[\s]+//g) { $id = lc($_); } elsif (s/^Data:[\s]+//g) { $data = lc($_); } #repeat for several labels $statement->execute($id,$data); $id = 0; $data = ""; }

    There's several pieces of data that get pulled out and and compared to the data that exists in the table for a given ID, but this should give an idea of what it's doing.

    As far as Devel::Leak, no haven't used it before. Will investigate.

    I'll try and break down the code to demonstrate the leak, but I have to figure out for certain what's causing it first.

      I seriously doubt that this would cause a memory leak, but that code sample suggests that $id and $data aren't needed outside the while loop. I always try to put variables in the innermost scope that they are needed.

      --PotPieMan

        I'd have thought so too, but the program hangs on one record, and I can bring up top and watch the process start eating memory until the machine hangs.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://273376]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (9)
As of 2024-04-19 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found