Constantly running out of memory in database.php

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
danfiscus
Posts: 3
Joined: Fri Feb 14, 2020 4:33 pm

Constantly running out of memory in database.php

Post by danfiscus »

No matter how much memory I allocate in php.ini, almost any action I try to perform will immediately start to hang, and eventually crash with this error in the console:

Code: Select all

ERROR PHP ERROR: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) in file: /var/www/html/cacti/lib/database.php on line: 476
What can I do? I've tried setting it higher and lower, I've played with the max runtime, max threads, and practically every other value in that config file, followed countless tutorials on google, and nothing helps. I must be missing something obvious here, but what?
This happens when I do pretty much anything, for example syncing 20-ish devices to their templates, renaming graphs, and so on. I'd say a little more than half the time this happens to me, it happens when I'm doing something involving graphs. In many cases, it will print this to the console on the line before it runs out of memory:

Code: Select all

AUTOM8 NOTE: [PID: 15947] create_graph_node() Graph[5906] Tree Item - Added - id: (1262)
Edit: just a heads up, my powers to do much with this issue over the weekend are very slim, so while I will read replies and answer what questions I can from home, I'll be out of the office away from my VM until Monday.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Constantly running out of memory in database.php

Post by netniV »

What version of cacti?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
danfiscus
Posts: 3
Joined: Fri Feb 14, 2020 4:33 pm

Re: Constantly running out of memory in database.php

Post by danfiscus »

What version of cacti?
I am on 1.2.8
danfiscus
Posts: 3
Joined: Fri Feb 14, 2020 4:33 pm

Re: Constantly running out of memory in database.php

Post by danfiscus »

This is new, I tried to sync two devices to the default template. When it failed and ran out of memory, the web interface showed some error messages as well. The first one matches the console error, but the second one has never appeared in the console and seems suspicious.

Code: Select all

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html/cacti/lib/database.php on line 476

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 86016 bytes) in Unknown on line 0
I am also attaching a text file that I copied and pasted the console output to, it's in the most verbose debug mode, containing the log output leading up to the memory crash. Hope this helps.
Attachments
full debug output for console when syncing two devices.txt
the console output from the time I press "continue" on the sync prompt until the time cacti runs out of memory.
(9.56 KiB) Downloaded 34 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Constantly running out of memory in database.php

Post by netniV »

What version of OS? Did you make the memory mods to both the Web and CLI versions of the PHP.INI ?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests