Jump to content

php memory problem


Jimmy99

Recommended Posts

I have osTicket  installed on a Centos 5 Os with php5.3.3

I upgraded the osTicket from v1.9.1 to 1.9.4

 

I now get the following mail when I create a ticket by mailing in the support ticket

 

This is the mail system at host mail.mydomain.com.

 

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

 

For further assistance, please send mail to <postmaster>

 

If you do so, please include this problem report. You can delete your own text from the attached returned message.

 

                   The mail system

 

<support@mydomain.com>: Command died with status 255: "/usr/bin/php -q

    /var/www/html/support/api/pipe.php". Command output: PHP Fatal error:

    Allowed memory size of 268435456 bytes exhausted (tried to allocate 76

    bytes) in /var/www/html/support/include/class.osticket.php on line 261 PHP

    Warning:  Unknown: Error occured while closing statement in Unknown on line

    0

 

The osticket guys have pointed out to me that this is a php error, but I never made any changes to the php config

 

When I increase the memory in php.ini to 512Mb or even 1024Mb the error persists.

Anyone have any ideas of whether the memory is set/can be set somewhere else or overriding what is in php.ini ?

 

 

Link to comment
Share on other sites

268,435,456 bytes (250+ MBytes) is a SIGNIFICANT amount of memory for any script to use and if when you change the memory limit, the amount of allowed memory listed in the error also went up to 512,xxx,xxx and then 1,024,xxx,xxx bytes, this indicates a script that will consuming all available memory, no matter how much you make available to it.

 

the script could either have a logic error that's consuming all memory (loading an array with the same data over and over in a loop for example) or of a script that needs to process a large amount of data, but isn't managing memory usage very well or at all.

 

in any case, you, or better yet, the program's authors, will need to debug what the code and data are doing to find what's causing the large memory usage.

 

edit: i downloaded the script, and the api/pipe.php page specifically sets the memory limit to 256M in the code.

Link to comment
Share on other sites

I increased the memory available to the script to 1Gb and it consumed all themeory and then some.

how do you know that the problem is in pipe.php and not class.osticket.php?

<support@mydomain.com>: Command died with status 255: "/usr/bin/php -q
    /var/www/html/support/api/pipe.php". Command output: PHP Fatal error:
    Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262097
    bytes) in /var/www/html/support/include/class.osticket.php on line 263 PHP
    Warning:  Unknown: Error occured while closing statement in Unknown on line
    0

Link to comment
Share on other sites

you won't directly know where the problem is at. the error is just being reported at the point in the code where the memory limit was exceeded. you would need to look at what the code was doing up to that point to pin down the problem.

 

this error is most likely due to an initialization problem, i.e. some variable wasn't initialized before/each-time through a loop or similar.

Link to comment
Share on other sites

Can you point me in the right direction to understand how one would debug a php application? From my perspective I am a little familiar with MS Visual Studio, where you can step into the code and check variable values as you go along. Does php have something similar, or what is the preferred method to debug a php script?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.