Re: ### Allocation failure

Scott Rogers <scott-t7/[email protected]> Tue, 15 Apr 2003 15:45:44 +0000
Newsgroups gmane.comp.lang.moto.devel
Message-ID <[email protected]>
Dave,

I did as you asked.  I turned off sessions for the compiled application a=
nd=20
received the same result on the FreeBSD box.  FYI I also modified=20
codex/sharedmem.h to execute the 'debug()' function when the error occurs=
=2E So=20
I have a 15mg httd error log with the tree dumps.  I don't understand how=
 to=20
interperet the output however.

I ran the app from the command line and received the following output:

=3D=3D=3D BEGIN output =3D=3D=3D
> /usr/local/moto/bin/moto -d hello.moto
/* */



<html>
<head>
<style type=3D"text/css">
      </style>
   </head>
   <body>

<hr>

Hello&nbsp;bob&nbsp;<br/>
Hello&nbsp;bobie&nbsp;
<hr/>



Title: Loud People Out Front


<hr>
   </body>
</html>

---------------------------------------------------------
Size Range Tree :
 |[0x28165000,0x2a165000)| =3D 33554432 id=3D12 pid=3D712816190
Allocated Range Tree :
According to lo-mem we have 1 nodes allocated
=3D=3D=3D END output =3D=3D=3D

On Tuesday 15 April 2003 05:21 pm, David Hakim wrote:
> Interesting ... I'm really surprised that this failure is occurring
> with the compiled module.
>
> Anyhow ... its pretty clear then that there is a memory leak at least
> somewhere. Since your test page isn't really using codex.http, could
> you run
>
> moto -d <test file>
>
> from the command line and verify that there are no leaks there ?
>
> Second, could you add the following directives to your httpd.conf:
>
> MotoOption Session.Disable TRUE
>
> changing the above to
>
> <CompiledModule>Option Session.Disable TRUE
>
> for your compiled module and re-run the ab tests ?
>
> -Dave
>
> On Tuesday, April 15, 2003, at 09:06  AM, Scott Rogers wrote:
> > David,
> >
> > I experienced the same behavior on the FreeBSD box in interperted and
> > compiled
> > mode.  I did not try interperted on the Linux box.
> >
> > I did nothing to turn off sessions.  So, if sessions are on 'out of
> > the box'
> > then they were on for these tests.
> >
> > Scott Rogers
> >
> > On Tuesday 15 April 2003 03:50 pm, David Hakim wrote:
> >> Is this under the interpreter or with a module compiled with mmc ?
> >> Also, are sessions turned off for this application ?
> >>
> >> -Dave
> >>
> >> On Tuesday, April 15, 2003, at 07:03  AM, Scott Rogers wrote:
> >>> Hey All,
> >>>
> >>> I recently did some performance testing of Moto on both FreeBSD 4.6=
=2E2
> >>> and
> >>> Redhat Linux 7.2.
> >>>
> >>> FreeBSD
> >>> Apache: 1.3.26
> >>> Moto: 0.19.0
> >>> 256mg ram
> >>>
> >>>
> >>> RedHat
> >>> Apache 1.3.27
> >>> Moto: 0.19.0
> >>> 1gig ram
> >>>
> >>> Using ApacheBench (ab with source distributions) in the following
> >>> manner:
> >>> ab -t 0 http://localhost/tmoto1/hello.moto
> >>>
> >>> This sends 50,000 connections to the server, one at a time.
> >>> Somewhere
> >>> between
> >>> 5000 and 10,000 connections, Moto starts sending "### Allocation
> >>> failure"
> >>> messages to the Apache error log file.
> >>>
> >>> I tracked this down to line 568 of src/codex/sharedmem.c.  It seems
> >>> there is
> >>> not enough contiguous memory, according to function "locateLPFNode"
> >>> at
> >>> line
> >>> #516.
> >>>
> >>> It seems when Moto is unable to return a large enough block of memo=
ry
> >>> from
> >>> it's internal stack, it issues the above warning/error message to
> >>> stderr.
> >>>
> >>> The problem is, it logs the message so many times it fills up my /v=
ar
> >>> file
> >>> system in a matter of seconds!
> >>>
> >>> Also, it is important to note, that on the FreeBSD system Moto
> >>> consumes all
> >>> available RAM, but not on the Linux box with 1gig of Ram.
> >>>
> >>>
> >>>
> >>> Here is the code excerpt:
> >>>
> >>> =3D=3D=3D BEGIN hello.moto =3D=3D=3D
> >>> $use("codex.http")
> >>> #include("my_classes.moto")
> >>>
> >>>
> >>> <html>
> >>> <head>
> >>> <style type=3D"text/css">
> >>>       </style>
> >>>    </head>
> >>>    <body>
> >>>
> >>> <hr>
> >>> ${
> >>> HelloWorld hw =3D new HelloWorld();
> >>> String message =3D hw.sayHelloTo("bob");
> >>> }$
> >>> $(message + "<br/>")
> >>> $(hw.sayHelloTo("bobie"))
> >>> <hr/>
> >>>
> >>> ${
> >>> Box box =3D new Box("Loud People Out Front");
> >>> }$
> >>>
> >>> $(box.renderStandard())
> >>>
> >>>
> >>> <hr>
> >>>    </body>
> >>> </html>
> >>> =3D=3D=3D END hello.moto =3D=3D=3D
> >>>
> >>>
> >>> =3D=3D=3D BEGIN my_classes.moto =3D=3D=3D
> >>> ${
> >>>    class HelloWorld {
> >>>       String sayHelloTo(String name){
> >>>         return "Hello&nbsp;" + name + "&nbsp;";
> >>>          }
> >>>       }
> >>>
> >>>
> >>>    class Box {
> >>>      boolean _initalized =3D false;
> >>>      String _title =3D "";
> >>>
> >>>       Box(String title) {
> >>>        this._title =3D title;
> >>>      }
> >>>
> >>>      String renderStandard() {
> >>>        return "Title: " + _title;
> >>>      }
> >>>    }
> >>>
> >>> }$
> >>> =3D=3D=3D END my_classes.moto =3D=3D=3D
> >>>
> >>>
> >>> Thanks,
> >>>
> >>> Scott Rogers