Re: [PHP] running out of memory processing result set on Linux, but not on Solaris

2010-07-13 Thread Ashley Sheridan
On Tue, 2010-07-13 at 11:06 -0600, Larry Martell wrote:

 I have an app that runs just fine on an older Solaris apache server
 (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer
 Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on
 the same mysql server, it fails with Allowed memory size exhausted.
 This occurs on a:
 
 $result = mysql_query($query, $db)
 
 statement. Both servers are running the identical query, which returns
 a result set under 0.5M. The Solaris server is configured with
 memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly
 something other then what I'm seeing is going on. Anyone know what
 could be causing this? Any php or apache build or config options that
 I could look at?
 
 TIA!
 


Is there any other place which your code is changing the memory_limit
parameter? I would assume this is unlikely, but sometimes even the
unlikely happens more than than it should!

Can you maybe strip the code down to a test case which causes the error?

Lastly, I do notice that you've got two different versions of PHP 
Apache installed on each OS, which could be the reason for the failure.
Maybe set up a VM or two to test things out. Have one VM with Solaris
and Apache/2.2.3-11  PHP/5.2.8, and another VM with Apache/2.0.53 
PHP/5.0.4 and see what happens. It could be that it's either Apache or
PHP or both causing the problems on your Linux system.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] running out of memory processing result set on Linux, but not on Solaris

2010-07-13 Thread Larry Martell
On Tue, Jul 13, 2010 at 11:11 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:

 On Tue, 2010-07-13 at 11:06 -0600, Larry Martell wrote:

 I have an app that runs just fine on an older Solaris apache server
 (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer
 Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on
 the same mysql server, it fails with Allowed memory size exhausted.
 This occurs on a:

 $result = mysql_query($query, $db)

 statement. Both servers are running the identical query, which returns
 a result set under 0.5M. The Solaris server is configured with
 memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly
 something other then what I'm seeing is going on. Anyone know what
 could be causing this? Any php or apache build or config options that
 I could look at?

 TIA!


 Is there any other place which your code is changing the memory_limit 
 parameter? I would assume this is unlikely, but sometimes even the unlikely 
 happens more than than it should!

The error message actually says Allowed memory size of 3355432 bytes
exhausted so I know it's using the 32M that it's set to php.ini. But
as I wrote above, on the Solaris server where it works, the
memory_limit is set to 8M.

 Can you maybe strip the code down to a test case which causes the error?

I've already done that - all it does it run a query and display the results.

 Lastly, I do notice that you've got two different versions of PHP  Apache 
 installed on each OS, which could be the reason for the failure.

Well, yes, that's what I said. And they may been built with different
config options. But what options could cause a difference like this?

 Maybe set up a VM or two to test things out. Have one VM with Solaris and 
 Apache/2.2.3-11  PHP/5.2.8, and another VM with Apache/2.0.53  PHP/5.0.4 
 and see what happens. It could be that it's either Apache or PHP or both
 causing the problems on your Linux system.

I don't have control of that. This is at a client site - they want to
get rid of their existing older Solaris apache server and move to a
newer Linux one. The servers are already set up they way they are. I
asked the admis for info on the build - they have it for the newer
Linux one, but not for the older Solaris one. They did give me another
machine to test on - that one is Linux, Apache 2.2.3, PHP 5.2.6 - that
also gets the out of memory error.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] running out of memory processing result set on Linux, but not on Solaris

2010-07-13 Thread Ashley Sheridan
On Tue, 2010-07-13 at 14:22 -0600, Larry Martell wrote:

 On Tue, Jul 13, 2010 at 11:11 AM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
 
  On Tue, 2010-07-13 at 11:06 -0600, Larry Martell wrote:
 
  I have an app that runs just fine on an older Solaris apache server
  (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer
  Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on
  the same mysql server, it fails with Allowed memory size exhausted.
  This occurs on a:
 
  $result = mysql_query($query, $db)
 
  statement. Both servers are running the identical query, which returns
  a result set under 0.5M. The Solaris server is configured with
  memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly
  something other then what I'm seeing is going on. Anyone know what
  could be causing this? Any php or apache build or config options that
  I could look at?
 
  TIA!
 
 
  Is there any other place which your code is changing the memory_limit 
  parameter? I would assume this is unlikely, but sometimes even the unlikely 
  happens more than than it should!
 
 The error message actually says Allowed memory size of 3355432 bytes
 exhausted so I know it's using the 32M that it's set to php.ini. But
 as I wrote above, on the Solaris server where it works, the
 memory_limit is set to 8M.
 
  Can you maybe strip the code down to a test case which causes the error?
 
 I've already done that - all it does it run a query and display the results.
 
  Lastly, I do notice that you've got two different versions of PHP  Apache 
  installed on each OS, which could be the reason for the failure.
 
 Well, yes, that's what I said. And they may been built with different
 config options. But what options could cause a difference like this?
 
  Maybe set up a VM or two to test things out. Have one VM with Solaris and 
  Apache/2.2.3-11  PHP/5.2.8, and another VM with Apache/2.0.53  PHP/5.0.4 
  and see what happens. It could be that it's either Apache or PHP or both
  causing the problems on your Linux system.
 
 I don't have control of that. This is at a client site - they want to
 get rid of their existing older Solaris apache server and move to a
 newer Linux one. The servers are already set up they way they are. I
 asked the admis for info on the build - they have it for the newer
 Linux one, but not for the older Solaris one. They did give me another
 machine to test on - that one is Linux, Apache 2.2.3, PHP 5.2.6 - that
 also gets the out of memory error.
 


That's why I suggested a VM, as you can have as many of these set up as
you need on your own computer to test things.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] running out of memory processing result set on Linux, but not on Solaris

2010-07-13 Thread Nathan Nobbe
On Tue, Jul 13, 2010 at 11:06 AM, Larry Martell la...@software-horizons.com
 wrote:

 I have an app that runs just fine on an older Solaris apache server
 (Apache/2.0.53 PHP/5.0.4), but when I run the same app on a newer
 Linux server (Apache/2.2.3-11 PHP/5.2.8) against the same database on
 the same mysql server, it fails with Allowed memory size exhausted.
 This occurs on a:

 $result = mysql_query($query, $db)

 statement. Both servers are running the identical query, which returns
 a result set under 0.5M. The Solaris server is configured with
 memory_limit = 8M in php.ini, and the Linux one with 32M, so clearly
 something other then what I'm seeing is going on. Anyone know what
 could be causing this? Any php or apache build or config options that
 I could look at?


are you sure the app doesnt have some other data loaded into memory before
running the query on the linux box?

you can use memory_get_usage() right before executing the query on the linux
box to determine if thats the case.

for example suppose the query takes .5M of memory, when you run it on the
solaris box only 4M of memory is currently in use and when you run it on the
linux box 31.7M of memory is in use.

another easy way to make the determination is to do as ashley suggested and
write a script which does nothing other than execute the query.

-nathan