mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #11709
[Bug 1132370] [NEW] Remove create_function() from dml.php to save memory
Public bug reported:
While trying to optimize memory usage in the mahara.org cron jobs (which
keep crashing due to running out of memory), I noticed from the error
stacks that it kept crashing on the call to create_function() in
db_quote_table_placeholders() in dml.php
The reason for this, is because functions created by create_function()
are never garbage collected. They persist for the lifetime of the
script's execution. Which means that if you put it inside a loop that
gets called thousands of times, it keeps using up more and more memory
with new copies of the function, until the script crashes from running
out of RAM.
There are about a dozen other usages of create_function() in Mahara's
codebase, but this is the only one that's likely to be used in a large
loop.
** Affects: mahara
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/1132370
Title:
Remove create_function() from dml.php to save memory
Status in Mahara ePortfolio:
New
Bug description:
While trying to optimize memory usage in the mahara.org cron jobs
(which keep crashing due to running out of memory), I noticed from the
error stacks that it kept crashing on the call to create_function() in
db_quote_table_placeholders() in dml.php
The reason for this, is because functions created by create_function()
are never garbage collected. They persist for the lifetime of the
script's execution. Which means that if you put it inside a loop that
gets called thousands of times, it keeps using up more and more memory
with new copies of the function, until the script crashes from running
out of RAM.
There are about a dozen other usages of create_function() in Mahara's
codebase, but this is the only one that's likely to be used in a large
loop.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1132370/+subscriptions
Follow ups
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-07-24
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-07-24
-
[Bug 1132370] A change has been merged
From: Mahara Bot, 2013-07-01
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-07-01
-
[Bug 1132370] A change has been merged
From: Mahara Bot, 2013-07-01
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-07-01
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-07-01
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Kristina Hoeppner, 2013-07-01
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Kristina Hoeppner, 2013-06-11
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Robert Lyon, 2013-06-11
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Aaron Wells, 2013-06-06
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Aaron Wells, 2013-04-29
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Kristina Hoeppner, 2013-04-28
-
[Bug 1132370] Re: Remove create_function() from dml.php to save memory
From: Aaron Wells, 2013-02-24
-
[Bug 1132370] [NEW] Remove create_function() from dml.php to save memory
From: Aaron Wells, 2013-02-24
References