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