Mailing List Archive

$|=1 under embperl
hi!

I'm trying to reduce the memory footprint that embperl pages leave
behind after displaying a large table taken from a large db. somehow I
find embperl's scalability here a problem, because it seems to process
the file in-memory until completion.

Of course it's not smart at all to be outputting 300kb of data in one
single page/table. But that's another issue, as I sometimes need to do
it. My backend/configuration pages *must* allow my client to peek into
huge datasets.

What's the equivalent of setting $| = 1 under plain CGI ? Will that
save memory somehow?


martin
Re: $|=1 under embperl [ In reply to ]
>
> What's the equivalent of setting $| = 1 under plain CGI ? Will that
> save memory somehow?
>
optEarlyHttpHeader
Re: $|=1 under embperl [ In reply to ]
gerald,

you're answering as fast as I can ask! call that tech support!

whew!

as this looks like my lucky day, I'd ask: will I save memory with this?


martin


Gerald Richter wrote:
>
> >
> > What's the equivalent of setting $| = 1 under plain CGI ? Will that
> > save memory somehow?
> >
> optEarlyHttpHeader
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
Re: $|=1 under embperl [ In reply to ]
>
> as this looks like my lucky day, I'd ask: will I save memory with this?
>

As you already mentioned normaly the whole page is buffered before it is
outputed. So what you save are the 300Kb your page has during output time.
Of course this memory is freed after the request. So it's only used for a
short time. Unless you have very many hit's on this large page, from my
point of view, this buffering will not matter or make any trouble.

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: $|=1 under embperl [ In reply to ]
Gerald Richter wrote:
> So what you save are the 300Kb your page has during output time.
> Of course this memory is freed after the request. So it's only used for a
> short time.

Gerald,

I know I'm stubborn. I understand that any memory that a mod_perl
script grabs won't be released until the httpd process is killed. Maybe
you're doing your buffering with your C code, and that memory does get
released when done?

is that what you men or I have a terrible misconception?


martin
Re: $|=1 under embperl [ In reply to ]
On Thu, Aug 03, 2000 at 11:30:32AM -0300, martin langhoff wrote:
> I know I'm stubborn. I understand that any memory that a mod_perl
> script grabs won't be released until the httpd process is killed. Maybe
> you're doing your buffering with your C code, and that memory does get
> released when done?

At least some Unix versions (for example linux) do really give the
free'd memory back for other processes to use. Some others just keep the
memory for some other usage in the same process.

--
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: $|=1 under embperl [ In reply to ]
> I know I'm stubborn. I understand that any memory that a mod_perl
> script grabs won't be released until the httpd process is killed. Maybe
> you're doing your buffering with your C code, and that memory does get
> released when done?
>
Embperl uses the Apache memory management for that purpose and Apache gives
it back after the request to the OS. What the OS actually does (if it's kept
for the same process or released) depends on your OS, like Jens-Uwe already
pointed out.

Gerald

P.S. If running as CGI, Embperl uses the C memory management