|
|
sybperl-l Archive
Up Prev Next
From: "Eddie Cheng" <EddieC at ActiveState dot com>
Subject: RE: Memory leak
Date: Apr 17 1998 11:24PM
I had a similar problem with DBlib before. I guess that,
since this is running a loop 20,000 times, any tiny memory
leak got magnified significantly. I ended up spawning a
child process to bcp the whole table into a file, and then
process the file using regular Perl.
Eddie
> -----Original Message-----
> From: owner-sybperl-l@trln.lib.unc.edu
> [mailto:owner-sybperl-l@trln.lib.unc.edu]On Behalf Of Shaun McClimon
> Sent: Friday, April 17, 1998 2:37 PM
> To: 'SYBPERL-L@trln.lib.unc.edu'
> Subject: FW: Memory leak
>
>
> Forgot the original select statement that starts it off. This can
> select up to 20000 rows.
>
> $SQL = "select * from ids1db..tESC";
>
> -----Original Message-----
> From: Shaun McClimon
> Sent: Friday, April 17, 1998 4:33 PM
> To: SYBPERL-L@trln.lib.unc.edu
> Subject: Memory leak
>
> Can someone help me with my code? This code continues to use memory up
> and has gotten as high as 40 megs. What is going on?
>
> Shaun
>
> $S = Sybase::CTlib->ct_connect($uid, $passwd, "$server");
> $T = Sybase::CTlib->ct_connect($uid, $passwd, "$server");
>
> $S->ct_command(CS_LANG_CMD,"$SQL", CS_NULLTERM,CS_UNUSED);
> $S->ct_send();
> while ($ret = $S->ct_results($restype) == CS_SUCCEED)
> {
> next if (!$S->ct_fetchable($restype));
> while(@dat = $S->ct_fetch) {
>
> $IDS = sprintf 'insert oecs..%s
> values ("%s","%s","%s","%s","%s","%s","%s","%s",
>
> "%s","%s",%s,%s,%s,%s,%s,%s,%s,%s,"%s",%s,%s,%s,"%s","%s
> ")',
> @dat[24], @dat[0], @dat[1], @dat[2], @dat[3],
> @dat[4],
> @dat[5], @dat[6], @dat[7], @dat[8], @dat[9],
> @dat[10],
> @dat[11], @dat[12], @dat[13], @dat[14],
> @dat[15],
> @dat[16], @dat[17], @dat[18], @dat[19],
> @dat[20],
> @dat[21], @dat[22], @dat[23]
> }
> $ref = $T->ct_sql($IDS);
> $del = $T->ct_sql("delete ids1db..tESC where counter =
> @dat[25]");
> }
> }
>
|