perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Gunton <n...@nilspace.com>
Subject Re: Nested <DL> Bug in 2.0b9
Date Tue, 27 Jan 2004 01:12:08 GMT
Neil Gunton wrote:
> More seriously, I am now encountering a problem with one of my pages,
> where the apache process runs away and fills up all the computer memory
> and swap space very quickly. The only way to recover is to shut down
> apache. I am still trying to nail down why this happens - it seems to
> have something to do with a [$sub$] calling a perl subroutine, which
> calls another [$sub$]. This is all using Embperl::Object. Thing is, I
> can switch things around and comment bits out and there is no one piece
> of code that seems to cause the problem. At first I thought I had it
> down to a loop which was outputting records from a database query, but
> then I tried commenting out a different piece of code a little later in
> the same [$sub$], and now the database loop works! I have a feeling that
> it's something related to nested calls between [$sub$] and Perl subs,
> but I can't as yet nail down the minimal case that makes it happen. I'll
> try and experiment more, but if you have ideas for capturing what's
> happening from logfiles as it runs wild, then tell me what to do and
> I'll try to generate some results for you. Meanwhile, I'll keep
> experimenting to get a minimal case for you.

Gerald, this is proving quite difficult to nail down to a simple minimal
case. For me, however, this code seems to produce the effect. If I
remove or change an part (e.g. remove one of the innermost tables) then
it works fine. But, for me, it runs away and fills up memory rapidly.

The xxxx and yyyy subs are in a file of subs named Directory.epl, which
is executed from base.epl. The routines are called from
/directory/index.html. There is Directory.epl in the base dir, and
Directory.epl in the /directory dir. There is only one version of xxxx
and yyyy, both in /directory/Directory.epl.

[$ sub yyyy $]

   [- ($self) = @_; -]

[$ endsub $]

[$ sub xxxx $]

   [- ($self) = @_; -]

   <TABLE>

   <TR>
      <TD>
	 <TABLE>
	    <TR>
	       <TD>
		  [- $x = 1; -]
		  [$ while $x < 10 $]
		    [+ $x +]
		    [- $x += 1; -]
		  [$ endwhile $]
	       </TD>
	    </TR>
	 </TABLE>
      </TD>

      <TD>
	 <TABLE>
	    <TR>
	       <TD>
	           <TABLE>
			[- $self->yyyy(); -]
		   </TABLE>
	       </TD>
	    </TR>
         </TABLE>
      </TD>

   </TR>
   </TABLE>

[$ endsub $]

The problem certainly seems to be related to embedded tables. Anyway,
let me know if this setup causes a runaway on your system, if not then
I'll try and nail it down to a simpler case.

Thanks,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message