[ZBX-6910] Fatal error: Allowed memory size Created: 2013 Aug 20 Updated: 2019 Dec 10 |
|
Status: | Open |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 2.1.3 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | Ivo Kurzemnieks | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | frontend, memory, sql | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | alerts.zip | ||||||||
Issue Links: |
|
Description |
This promblem has been before and appears again from time to time due to large amounts of data. The installation states that required memory is 128MB, but sometimes it's not enough. In Administration > Notifications I get error: |
Comments |
Comment by Alexei Vladishev [ 2013 Aug 20 ] |
I am not sure it should be treated a s a bug. Obviously amount of required memory depends on size of our monitored environment. |
Comment by Ivo Kurzemnieks [ 2013 Aug 21 ] |
Wasn't sure either, but maybe this issue can server as discussion and raise awareness that these kind of problems still exist. My environment is rather small. We can treat it a bug, and say that this happens due to bad coding. For example the in file I mentioned, there is foreach cycle and in it there is a request to DB. That happens every time. In the end there is so much data, that PHP memory overflows. So here are some options: 1) Move request out of foreach, make request only once and try to assemble data afterwards. I'm just shooting some random ideas. |
Comment by Pavels Jelisejevs (Inactive) [ 2013 Sep 24 ] |
We should check if we can optimize the code on the page to use less memory. |
Comment by Ivo Kurzemnieks [ 2013 Sep 26 ] |
The problem is with DB request it self. After executing query mysqli_query(), the amount of data is already about 65MB. While doing the while loop _fetch_assoc() the memory exeeds the limit in about 40k row. Tried experimenting with request with mysqli_real_request(), but with no luck so far. Maybe the query can be split into multiple smaller requests. |
Comment by richlv [ 2013 Sep 29 ] |
not related to notifications page, but importing 98 hosts without any items or triggers needs more than 64mb of memory. maybe long term we should investigate some general approaches to reducing memory usage |