You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by MaurĂ­cio Amorim <ma...@terra.com.br> on 2003/07/04 20:40:23 UTC

Out of Memory

Hi list,

I developed an site in Embperl for documents version controls.
This site run in Linux (RedHat).

After 2 weeks the message Out of memory is displayed in console of Linux and
I had that inicialize the Linux.

I am using DBD::Oracle and i'm not using $sth->finish in sql statements.

The out of memory problem occured because i'm not using $sth->finish ?

I change the parameter MaxRequestsPerChild of 0 to 100.  
It will resolve the problem or a have to change the code of my epl files ?

I am using apache 1.3.27 and Embperl 1.3.6.

Thank you.

Re: Out of Memory

Posted by Donovan Allen <al...@votehere.net>.
>
>
>>The out of memory problem occured because i'm not using $sth->finish ?
>>    
>>
>
>Normaly this shouldn't be a problem. I guess there is somethingelse in your
>code that eats up memory...
>  
>
>>I change the parameter MaxRequestsPerChild of 0 to 100.
>>It will resolve the problem or a have to change the code of my epl files ?
>>    
>>
>
>This is a workaround, that will at least avoid the out of memory problem
>
>Gerald
>  
>
In general, all of my memory leaks with embperl have been the result of 
3rd party modules or my own modules not providing a "my" scope on 
variables.  This isn't the cause, which is infact usually something more 
silly like; $myvar .= "something more" or push @myarray,"more stuff".

Get in the habit of writing module code like this:

sub do_this {
  my ($myvar,@myarray,%myhash,$myothervar);
  # ... code ...
}

The above practice will save you from yourself.  

I have found at least 10 CPAN modules that have memory leaks due to this 
sort of thing as well.  So, you might have to isolate the leak in any 
modules you use.

The key to remember here is that the modules are stored in memory 
w/mod_perl, so properly scope ALL module variables.  Unless someone has 
used a module in a long running daemon/mod_perl code, they will likely 
never have noticed the leak.


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


Re: Out of Memory

Posted by Gerald Richter <ri...@ecos.de>.

>The out of memory problem occured because i'm not using $sth->finish ?

Normaly this shouldn't be a problem. I guess there is somethingelse in your
code that eats up memory...

>I change the parameter MaxRequestsPerChild of 0 to 100.
>It will resolve the problem or a have to change the code of my epl files ?

This is a workaround, that will at least avoid the out of memory problem

Gerald



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