View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015411 | mantisbt | performance | public | 2013-01-22 20:14 | 2014-09-23 18:05 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.13 | ||||
Target Version | 1.2.14 | Fixed in Version | 1.2.14 | ||
Summary | 0015411: Huge memory consumption for print_user_option_list() | ||||
Description | Following the implementation of the fix for 0010130, calling this function when the current project is ALL_PROJECTS causes a massive surge in memory usage, due to repeated calls to array_merge() as the code builds a very large array containing the list of all users in all projects accessible to the current user, and then reduces it to remove duplicates. The code must be optimized to reduce memory consumption. | ||||
Additional Information | With about 21'000 records in the user table, the memory footprint of calling this function for all projects is as follows:
| ||||
Tags | No tags attached. | ||||
related to | 0010130 | closed | dregad | Filter "Assigned to" does not display usernames when project "All Projects" is selected |
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
has duplicate | 0015347 | closed | dregad | Bad performance and memory issue with print_user_option_list |
related to | 0012677 | closed | atrol | Please change a search option to manage users |
related to | 0017490 | closed | dregad | Click Manage Configuration produces blank page |
With the attached commit, memory usage is reduced to approx 180M. I don't see how it can be further reduced. As mentioned on the mailing list [1], I believe that in the future we should refactor the way we deal with user [1] http://thread.gmane.org/gmane.comp.bug-tracking.mantis.devel/4230/focus=4245 |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x e61e63ca 2013-01-22 20:26 Details Diff |
Fix huge memory consumption for print_user_option_list() Following the implementation of the fix for 0010130, calling this function when the current project is ALL_PROJECTS causes a massive surge in memory usage as the code builds a large array containing the list of all users in all projects accessible to the current user, and then reduces it to remove duplicates. This commit reduces the problem by removing calls to array_merge() and building the consolidated user list in a single pass, using a while loop. No-longer-used arrays are unset to free up memory. Fixes 0015411 |
Affected Issues 0015411 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master f977b3ca 2013-01-22 20:26 Details Diff |
Fix huge memory consumption for print_user_option_list() Following the implementation of the fix for 0010130, calling this function when the current project is ALL_PROJECTS causes a massive surge in memory usage as the code builds a large array containing the list of all users in all projects accessible to the current user, and then reduces it to remove duplicates. This commit reduces the problem by removing calls to array_merge() and building the consolidated user list in a single pass, using a while loop. No-longer-used arrays are unset to free up memory. Fixes 0015411 |
Affected Issues 0015411 |
|
mod - core/print_api.php | Diff File |