View Issue Details

IDProjectCategoryView StatusLast Update
0015411mantisbtperformancepublic2014-09-23 18:05
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.13 
Target Version1.2.14Fixed in Version1.2.14 
Summary0015411: 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:

  • in 1.2.12: ~150M
  • in 1.2.13: ~650M (!)
TagsNo tags attached.

Relationships

related to 0010130 closeddregad Filter "Assigned to" does not display usernames when project "All Projects" is selected 
related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0015347 closeddregad Bad performance and memory issue with print_user_option_list 
related to 0012677 closedatrol Please change a search option to manage users 
related to 0017490 closeddregad Click Manage Configuration produces blank page 

Activities

dregad

dregad

2013-01-24 03:25

developer   ~0034884

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
selection lists, maybe by switching to an ajax-based user entry text field
with autocomplete, along the lines of what was proposed by Daryn in 0012677.

[1] http://thread.gmane.org/gmane.comp.bug-tracking.mantis.devel/4230/focus=4245

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036103

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x e61e63ca

2013-01-22 20:26

dregad


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

dregad


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