Re: FCGI/perl memory leakage

Sven Verdoolaege (skimo@breughel.ufsia.ac.be)
Mon, 7 Apr 1997 17:25:29 +0200

Message-Id: <19970407172529.HR30367@breughel.ufsia.ac.be>
Date: Mon, 7 Apr 1997 17:25:29 +0200
From: skimo@breughel.ufsia.ac.be (Sven Verdoolaege)
To: fastcgi-developers@OpenMarket.com
Subject: Re: FCGI/perl memory leakage
In-Reply-To: <19970402150353.DV39224@breughel.ufsia.ac.be>; from Sven Verdoolaege on Apr 2, 1997 15:03:53 +0200

On Apr 2, skimo@breughel.ufsia.ac.be (Sven Verdoolaege) wrote:
> I think I've located the problem.
> perl is trying to be smart and postpones the desruction of hash elements
> till ... never in this case.

This is probably misinformation. The problem seem to be more involved,
but it does seem to be a perl problem.

> Quick solution is to uncomment the hv_delete in line 172 of FCGI.xs .
> This may have unwanted side effects.
Of course what meant was:
This will have side effects that may be unwanted.

Slightly better solution is to replace the hv_delete with

hv_store(hv, p, p1 - p, newSV(0), 0);

This way, you won't get old environment values, but you will
get empty values if the variable ever existed, so code
using exists or defined on %ENV elements won't work.

skimo