Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIaKX-000721-V0 for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Feb 2014 08:59:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WIaKX-00015w-DV for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Feb 2014 08:59:05 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIaKV-00014E-Li; Wed, 26 Feb 2014 08:59:03 +0000 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIaKT-00007b-Hh; Wed, 26 Feb 2014 08:59:03 +0000 Received: by mail-lb0-f181.google.com with SMTP id c11so393422lbj.40 for ; Wed, 26 Feb 2014 00:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=BCh8S21TH9r0bcgAB/rOqWJhLBtrJFxnoNlaTpzR4fs=; b=mnsp6zypbFG3tGzWjHJ2FbqNoptU9HY1VUtTlkh991ebEGfks+hTyABwCFRgHO5KSV FvEEDkecX06k4vnolCUOAnaQUVvfpdh1rQ7ki9PKbsFyvRQOzsS9rKlYFyi+mFPEpBNg kloHDnx9RKG+8Yv7nApIoxcXj2kPseU481oST0rpWk+T0vLv3H5qF65eGFt6vTQCyUB1 QZHRELsD8+0icoN5+nRwn9nbx/KJbwAxsIxAL1jA5yr9dX8A13wC98J3aGYZ1PczaOFo KiprTW0cTCa1qNrZUtA76ldEYI3lIrkCTcHo64/Lo7r7HrbQcHJadrGqGLiGB9W0SGL2 wVCA== X-Received: by 10.152.28.7 with SMTP id x7mr635547lag.57.1393405139681; Wed, 26 Feb 2014 00:58:59 -0800 (PST) Received: from seb.koffice.internal (koffice.avito.ru. [195.151.206.25]) by mx.google.com with ESMTPSA id h7sm373898lbj.1.2014.02.26.00.58.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 00:58:58 -0800 (PST) From: Sergey Burladyan To: Alex Hunsaker Cc: pgsql-bugs , PostgreSQL-development Subject: Re: BUG #9223: plperlu result memory leak References: <20140214163125.24620.66179@wrigleys.postgresql.org> <87ppmbmh3i.fsf@seb.koffice.internal> Date: Wed, 26 Feb 2014 12:58:57 +0400 In-Reply-To: (Alex Hunsaker's message of "Tue, 25 Feb 2014 13:46:30 -0700") Message-ID: <87lhwymer2.fsf@seb.koffice.internal> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alex Hunsaker writes: > On Tue, Feb 25, 2014 at 6:56 AM, Sergey Burladyan wrote: > > > It looks like I found the problem, Perl use reference count and something that > > is called "Mortal" for memory management. As I understand it, mortal is free > > after FREETMPS. Plperl call FREETMPS in plperl_call_perl_func() but after it, > > plperl ask perl interpreter again for new mortal SV variables, for example, in > > hek2cstr from plperl_sv_to_datum, and this new SV is newer freed. > > So I think hek2cstr is the only place we leak (its the only place I > can see that allocates a mortal sv without being wrapped in > ENTER/SAVETMPS/FREETMPS/LEAVE). Yeah, I also try to fix only hek2cstr, but failed. > Does the attached fix it for you? Yes, your patch is fix it for me, thank you, Alex! -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs