New install PHP fatal error (memory size)

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
indifferent51
Posts: 1
Joined: Thu Mar 04, 2010 12:25 pm

New install PHP fatal error (memory size)

Post by indifferent51 »

I am trying to install a new cacti instance, but I keep getting the following error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 523800 bytes) in /pkgs/cacti/0.8.7e/lib/adodb/adodb.inc.php on line 833
My PHP "memory_limit" is set to 512M. It was originally 128M, but I bumped it up in hopes that would help.

This is a brand new install. Fresh download and completely clean/empty database.

OS: RedHat EL 5
Apache: 2.2.3
PHP: 5.3.1
Cacti: 0.8.7e
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Plese import cacti.sql into the cacti db and retry
R.
regulatre
Posts: 3
Joined: Thu Dec 02, 2010 9:55 am

Re: New install PHP fatal error (memory size)

Post by regulatre »

Even though this is an old issue I wanted to post a solution that worked for me. I seem to run into this periodically and it's hard to troubleshoot because the error is misleading. Current version I'm running is cacti-0.8.8a-2.el6.noarch on a server with 4GB of memory.

While I ran into the memory exhausted errors in error_log and when running the php manually I decided to run strace as a quick and dirty way to trace the execution. I got lucky and strace exposed the loop that is occurring which presumably is what leads to the memory exhaustion (recursion or memory leak?). I was able to identify my mistake (error in my grant statement, granted access to table only "cacti" rather than all tables "cacti.*" ) and correct the problem to fix the problem at its root.

Code: Select all

mysql> use cacti; grant all privileges on cacti.* to USERNAME@'localhost' identified by 'PASSWORD';

Details of what I saw in the strace:

Code: Select all

read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
poll([{fd=3, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(3, "@\0\0\0\3select value from `cacti`.`"..., 68) = 68
read(3, "M\0\0\1\377v\4#42000SELECT command deni"..., 16384) = 81
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests