Memory Limit for for HTML pages??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vic Spainhower

    Memory Limit for for HTML pages??

    Hello,

    I have a php program that is building a grid (HTML table) from a MySQL
    database. The problems started when I added a dropdown menu to the grid and
    when I did the form buttons would not work when there were a few values in
    the drop-down. If I removed the values so it was an empty drop-down menu the
    form buttons would work. I thought there was a problem with my drop-down
    which is a quite simple menu.

    However, what I discovered is that it has to do with the size of the table
    that I am building. I changed the query so that it would only pick up about
    1/2 the records (134 vs 248) which is where it works (the 135th record
    causes the buttons to quit working. It is not a data problem because I then
    tested with a different set of data and it would also fail but at a
    different spot.

    I must be running into some kind of memory limit but I have no idea what it
    is! Can someone help?

    Vic



  • Iván Sánchez Ortega

    #2
    Re: Memory Limit for for HTML pages??

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Vic Spainhower wrote:
    [color=blue]
    > I must be running into some kind of memory limit but I have no idea what
    > it is! Can someone help?[/color]

    You may be hitting PHP's 8 MB memory limit. That value is a default, so if
    you really *need* to run a script which consumes more memory than that,
    edit your php.ini file in order to change the memory limit value...

    - --
    - ----------------------------------
    Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

    Me acuerdo de que hace años un DECman tenía que actualizar el microcódigo de
    un VAX 8250 y le mandaron un floppy por mensajero. El floppy resultó
    ilegible, y el decman lo devolvió con una nota en la que se podía leer:

    %BADFLOPPY-F-VESPINOISNOTALL OWED; This diskette has been demagnetised. The
    compatibility of this hardware with a Vespino's Magneto has not been
    certified. Please use a Taxi.
    --Jordi Guillaumes.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)

    iD8DBQFDmh7M3jc Q2mg3Pc8RAnbFAJ 4jPa6FzDCvqE7yV bTXWOenzZmR6ACe NhMc
    UTC6KxItaT3cJIi DtiS57Q4=
    =Dtsg
    -----END PGP SIGNATURE-----

    Comment

    • Vic Spainhower

      #3
      Re: Memory Limit for for HTML pages??

      Ivan,

      I don't think it's the 8meg limit because the HTML is being built correctly.
      I can take the generated html and create another page and it fails in the
      same way.

      Vic


      "Iván Sánchez Ortega" <i.punto.sanche z--@rroba--mirame.punto.ne t> wrote in
      message news:nfjp63-tg7.ln1@blacksp ark.escomposlin ux.org...[color=blue]
      > -----BEGIN PGP SIGNED MESSAGE-----
      > Hash: SHA1
      >
      > Vic Spainhower wrote:
      >[color=green]
      >> I must be running into some kind of memory limit but I have no idea what
      >> it is! Can someone help?[/color]
      >
      > You may be hitting PHP's 8 MB memory limit. That value is a default, so if
      > you really *need* to run a script which consumes more memory than that,
      > edit your php.ini file in order to change the memory limit value...
      >
      > - --
      > - ----------------------------------
      > Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net
      >
      > Me acuerdo de que hace años un DECman tenía que actualizar el microcódigo
      > de
      > un VAX 8250 y le mandaron un floppy por mensajero. El floppy resultó
      > ilegible, y el decman lo devolvió con una nota en la que se podía leer:
      >
      > %BADFLOPPY-F-VESPINOISNOTALL OWED; This diskette has been demagnetised. The
      > compatibility of this hardware with a Vespino's Magneto has not been
      > certified. Please use a Taxi.
      > --Jordi Guillaumes.
      > -----BEGIN PGP SIGNATURE-----
      > Version: GnuPG v1.4.2 (GNU/Linux)
      >
      > iD8DBQFDmh7M3jc Q2mg3Pc8RAnbFAJ 4jPa6FzDCvqE7yV bTXWOenzZmR6ACe NhMc
      > UTC6KxItaT3cJIi DtiS57Q4=
      > =Dtsg
      > -----END PGP SIGNATURE-----[/color]


      Comment

      • maraguida@gmail.com

        #4
        Re: Memory Limit for for HTML pages??

        Vic Spainhower wrote:[color=blue]
        > I have a php program that is building a grid (HTML table) from a MySQL
        > database. The problems started when I added a dropdown menu to the grid and
        > when I did the form buttons would not work when there were a few values in
        > the drop-down. ...
        >
        > However, what I discovered is that it has to do with the size of the table
        > that I am building. I changed the query so that it would only pick up about
        > 1/2 the records (134 vs 248) which is where it works (the 135th record
        > causes the buttons to quit working. It is not a data problem because I then
        > tested with a different set of data and it would also fail but at a
        > different spot.[/color]

        Are you sure it is not a data problem?
        Can you try the dropdown with just the 135th record?

        Comment

        • Vic Spainhower

          #5
          Re: Memory Limit for for HTML pages??

          Maraguida,

          I changed the query so that it would only pick up records starting with the
          135th record. With this set of records it is ok the button works. So I
          believe this indicates that it is not a data problem.

          Vic



          <maraguida@gmai l.com> wrote in message
          news:1134181119 .160444.93850@g 14g2000cwa.goog legroups.com...[color=blue]
          > Vic Spainhower wrote:[color=green]
          >> I have a php program that is building a grid (HTML table) from a MySQL
          >> database. The problems started when I added a dropdown menu to the grid
          >> and
          >> when I did the form buttons would not work when there were a few values
          >> in
          >> the drop-down. ...
          >>
          >> However, what I discovered is that it has to do with the size of the
          >> table
          >> that I am building. I changed the query so that it would only pick up
          >> about
          >> 1/2 the records (134 vs 248) which is where it works (the 135th record
          >> causes the buttons to quit working. It is not a data problem because I
          >> then
          >> tested with a different set of data and it would also fail but at a
          >> different spot.[/color]
          >
          > Are you sure it is not a data problem?
          > Can you try the dropdown with just the 135th record?
          >[/color]


          Comment

          • Oli Filth

            #6
            Re: Memory Limit for for HTML pages??

            Vic Spainhower said the following on 09/12/2005 23:30:[color=blue]
            > Hello,
            >
            > I have a php program that is building a grid (HTML table) from a MySQL
            > database. The problems started when I added a dropdown menu to the grid and
            > when I did the form buttons would not work when there were a few values in
            > the drop-down. If I removed the values so it was an empty drop-down menu the
            > form buttons would work. I thought there was a problem with my drop-down
            > which is a quite simple menu.
            >
            > However, what I discovered is that it has to do with the size of the table
            > that I am building. I changed the query so that it would only pick up about
            > 1/2 the records (134 vs 248) which is where it works (the 135th record
            > causes the buttons to quit working. It is not a data problem because I then
            > tested with a different set of data and it would also fail but at a
            > different spot.
            >[/color]

            Can you post a URL to the site so we can take a look at the HTML?

            Can you confirm that the HTML is valid?
            W3C's easy-to-use markup validation service, based on SGML and XML parsers.



            --
            Oli

            Comment

            • Mara Guida

              #7
              Re: Memory Limit for for HTML pages??

              Vic Spainhower wrote:[color=blue]
              > I changed the query so that it would only pick up records starting with the
              > 135th record. With this set of records it is ok the button works. So I
              > believe this indicates that it is not a data problem.[/color]

              I'm still not convinced.
              Try this:

              Instead of putting the value from the database in the select put a
              count of options and try all the records (or just the subset from
              record 1 to record 135)

              // ...
              $option_count = 0;
              while ($row = mysql_fetch_row ()) {
              ### echo '<option>', $row[2], '</option>';
              echo '<option>', ++$option_count , '</option>';
              }
              // ...

              Comment

              • Vic Spainhower

                #8
                Re: Memory Limit for for HTML pages??

                *** Solved ***

                It appears the problem is there is some sort of limit when using method=GET
                in the HTML FORM statement and this limit was being exceeded. I changed the
                form statement to method=POST and it is now working correctly. I don't know
                know what the limit is for using GET and I suppose it's possible that POST
                varaibles also have a limit but obviously more then GET.

                I want to thank everyone for taking the time to reply to my post as it
                really did help getting to the bottom of this problem.

                Vic




                Comment

                • Mara Guida

                  #9
                  Re: Memory Limit for for HTML pages??

                  Vic Spainhower wrote:[color=blue]
                  > *** Solved ***[/color]

                  Good :)
                  [color=blue]
                  > It appears the problem is there is some sort of limit when using method=GET
                  > in the HTML FORM statement and this limit was being exceeded. I changed the
                  > form statement to method=POST and it is now working correctly.[/color]
                  <snip>

                  <quote src="rfc2616">
                  The HTTP protocol does not place any a priori limit on the length of
                  a URI. Servers MUST be able to handle the URI of any resource they
                  serve, and SHOULD be able to handle URIs of unbounded length if they
                  provide GET-based forms that could generate such URIs. A server
                  SHOULD return 414 (Request-URI Too Long) status if a URI is longer
                  than the server can handle (see section 10.4.15).

                  Note: Servers ought to be cautious about depending on URI lengths
                  above 255 bytes, because some older client or proxy
                  implementations might not properly support these lengths.
                  </quote>


                  Let me just add that your initial post led us all thinking about a
                  problem you didn't have.
                  [color=blue][color=green][color=darkred]
                  >>> The problems started when I added a dropdown menu to the grid
                  >>> and when I did the form buttons would not work when there were
                  >>> a few values in the drop-down.[/color][/color][/color]

                  The form buttons have been working all the time, with 134 records or
                  248!
                  The form would be submitted -- that's what the buttons are for.

                  Comment

                  • Vic Spainhower

                    #10
                    Re: Memory Limit for for HTML pages??

                    >The form buttons have been working all the time, with 134 records or 248![color=blue]
                    >The form would be submitted -- that's what the buttons are for.[/color]

                    Mara,

                    The problem that I originally stated was "is there a memory limit for HTML
                    pages?" The form buttons did stop working when I added a dropdown menu to
                    the table (which was part of the form). Why do you say they were not working
                    Mara? I press the submit button and nothing happens! That to me is not
                    working. I thought there may have been a memory limit of some sort because
                    if was definitely related to the size of the table being constructed. If the
                    server was supposed to return a 414 it did not. I appologise if I anyone was
                    misslead as to how I stated the problem. I only stated in the best way I
                    could and what I was seeing.

                    Vic



                    "Mara Guida" <maraguida@gmai l.com> wrote in message
                    news:1134250253 .424970.95980@f 14g2000cwb.goog legroups.com...[color=blue]
                    > Vic Spainhower wrote:[color=green]
                    >> *** Solved ***[/color]
                    >
                    > Good :)
                    >[color=green]
                    >> It appears the problem is there is some sort of limit when using
                    >> method=GET
                    >> in the HTML FORM statement and this limit was being exceeded. I changed
                    >> the
                    >> form statement to method=POST and it is now working correctly.[/color]
                    > <snip>
                    >
                    > <quote src="rfc2616">
                    > The HTTP protocol does not place any a priori limit on the length of
                    > a URI. Servers MUST be able to handle the URI of any resource they
                    > serve, and SHOULD be able to handle URIs of unbounded length if they
                    > provide GET-based forms that could generate such URIs. A server
                    > SHOULD return 414 (Request-URI Too Long) status if a URI is longer
                    > than the server can handle (see section 10.4.15).
                    >
                    > Note: Servers ought to be cautious about depending on URI lengths
                    > above 255 bytes, because some older client or proxy
                    > implementations might not properly support these lengths.
                    > </quote>
                    >
                    >
                    > Let me just add that your initial post led us all thinking about a
                    > problem you didn't have.
                    >[color=green][color=darkred]
                    >>>> The problems started when I added a dropdown menu to the grid
                    >>>> and when I did the form buttons would not work when there were
                    >>>> a few values in the drop-down.[/color][/color]
                    >
                    > The form buttons have been working all the time, with 134 records or
                    > 248!
                    > The form would be submitted -- that's what the buttons are for.
                    >[/color]


                    Comment

                    • Mara Guida

                      #11
                      Re: Memory Limit for for HTML pages??

                      Vic Spainhower wrote:[color=blue][color=green]
                      > >The form buttons have been working all the time, with 134 records or 248!
                      > >The form would be submitted -- that's what the buttons are for.[/color]
                      >
                      > Mara,
                      >
                      > The problem that I originally stated was "is there a memory limit for HTML
                      > pages?"[/color]

                      No, for pratical purposes, there isn't.
                      So your problem must be something else.
                      [color=blue]
                      > The form buttons did stop working when I added a dropdown menu to
                      > the table (which was part of the form).[/color]

                      No, they didn't -- and that's my point!
                      If the buttons had stopped working, changing the method from POST to
                      GET wouldn't accomplish anything.
                      [color=blue]
                      > Why do you say they were not working
                      > Mara?[/color]

                      See above.
                      [color=blue]
                      > I press the submit button and nothing happens![/color]

                      Nothing?
                      The address in the address bar doesn't get crowded?
                      The server log doesn't show a new request at the time you pressed the
                      button?
                      Doesn't the browser get a new page (with the same content)?
                      [color=blue]
                      > That to me is not working.[/color]

                      The way I read your problem it seemed something like

                      This works
                      <form action="whateve r">
                      <input type="submit">
                      </form>

                      When I add a select it wil not work
                      <form action="whateve r">
                      <select>
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      </select>
                      <!-- This is just an example -->
                      <!-- I'm sure adding a select does not change the input type
                      -->
                      <input type="button" value="Submit Query">
                      </form>


                      <snip>

                      Comment

                      Working...