This is just a guess, but I would try moving the "my $j" outside of the for loop. This way you're quoting the same $j each time which instead of creating a new one and then relying on "undef" to free up the memory. I'm fairly new to Perl so I might not know what I'm talking about, but I'm very experienced in C++, which has numerous memory management issues I've struggled with.

Good Luck,

Gregg Allen

my $dbh = DBI->connect($data_source, $username, $password)
my $i;
my $j;
for ($i=1;$i<=100000000;$i++){
# memory leak is here
$j=$dbh->quote("JDXHFGURSEFUDSBE hd2bgrkdbfgbdlbg''lsjfskrde");
# in $dbh->quote()


      #  undef $j;
}




On Sunday, June 29, 2003, at 10:13 AM, íÏÎÁÛ£× íÉÈÁÉÌ wrote:


#!/usr/local/bin/perl -w


use strict;
use DBI;

my $dbh = DBI->connect($data_source, $username, $password)
my $i;
for ($i=1;$i<=100000000;$i++){
# memory leak is here
my $j=$dbh->quote("JDXHFGURSEFUDSBE hd2bgrkdbfgbdlbg''lsjfskrde");
# in $dbh->quote()


        undef $j;
}
undef $i;
$dbh->disconnect();
undef $dbh;

you can change this code:

  return "'$str'";
  and this
  return "$lp$str$ls";

to :

  return "'".$str."'";
  and
  return $lp.$str.$ls;

concatination is better way, that "xxx $var xxx" !

Thanks anyway, and sorry for my english.


С уважением, Монашёв Михаил, SoftSearch.ru ICQ# 166233339 http://softsearch.ru/ Без бэкапа по жизни.

  • ... Монашёв Михаил
    • ... Монашёв Михаил
      • ... gregg
        • ... Монашёв Михаил
          • ... Ronald J Kimball
            • ... Монашёв Михаил
              • ... Rudy Lippan
                • ... Монашёв Михаил
                • ... Paul Boutros
                • ... Монашёв Михаил
                • ... Rudy Lippan
                • ... Монашёв Михаил
                • ... Rudy Lippan

Reply via email to