Loading ...
Sorry, an error occurred while loading the content.
 

Re: [mp2] Am I leaking memory?

Expand Messages
  • Joe Schaefer
    Beau E. Cox writes: [...] ... No, your change is fine. AFAICT that comment pertains to an esoteric problem with object cleanup in
    Message 1 of 3 , Feb 2, 2004
      "Beau E. Cox" <beau@...> writes:

      [...]

      > The only place in my Mason changes I can see anything funny is:
      >
      > # This gets the proper request object all in one fell swoop. We
      > # don't want to copy it because if we do something like assign an
      > # Apache::Request object to a variable currently containing a
      > # plain Apache object, we leak memory. This means we'd have to
      > # use multiple variables to avoid this, which is annoying.
      > my $r =
      > $r_sub->( $self->args_method eq 'mod_perl' ?
      > Apache::Request->new( $_[0] ) :
      > $_[0]
      > );
      >
      > I changed:
      > Apache::Request->instance( $_[0] ) :
      > to:
      > Apache::Request->new( $_[0] ) :
      >
      > Is that causing trouble?

      No, your change is fine. AFAICT that comment pertains to an esoteric
      problem with object cleanup in libapreq/mp1, but the bug doesn't
      seem to be carried over into mp2/apreq2 (the apreq2 test suite has
      a test for it).

      --
      Joe Schaefer


      --
      Reporting bugs: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
      List etiquette: http://perl.apache.org/maillist/email-etiquette.html
    • Stas Bekman
      ... Also if you have libgtop, you can use a more flexible way to detect leaks. See
      Message 2 of 3 , Feb 2, 2004
        Beau E. Cox wrote:
        > -------------8<---------- Start Bug Report ------------8<----------
        > 1. Problem Description:
        >
        > I've got my Mason w/mod_perl2 and libapreq2 system
        > up and running OK, but...
        >
        > Using a simple script that totals ALL httpd processes' memory
        > usage (from /proc/pid/status) I get this before any
        > requests into the server:
        >
        > VmData VmExe VmLck VmLib VmRSS VmSize VmStk
        > 4297576 32248 0 524944 1479132 4904200 2784
        > 4297576 32248 0 524944 1479132 4904200 2784
        > ...
        >
        > And this after about 50,000 hits to Mason-enabled pages:
        >
        > VmData VmExe VmLck VmLib VmRSS VmSize VmStk
        > 4605240 32248 0 538272 1801692 5226200 2784
        > 4605240 32248 0 538272 1801692 5226200 2784
        >
        > Note the increase to VmSize.

        Also if you have libgtop, you can use a more flexible way to detect leaks. See
        http://cvs.apache.org/viewcvs.cgi/modperl-2.0/t/conf/modperl_extra.pl?r1=1.39&r2=1.40&diff_format=h
        You can braket your code sections and see which ones add more memory requirements.

        __________________________________________________________________
        Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        mailto:stas@... http://use.perl.org http://apacheweek.com
        http://modperlbook.org http://apache.org http://ticketmaster.com

        --
        Reporting bugs: http://perl.apache.org/bugs/
        Mail list info: http://perl.apache.org/maillist/modperl.html
        List etiquette: http://perl.apache.org/maillist/email-etiquette.html
      Your message has been successfully submitted and would be delivered to recipients shortly.