Commits

Sebastian Sdorra committed bf4d1ba

create a copy of search result collection to reduce memory of caches

Comments (0)

Files changed (1)

scm-webapp/src/main/java/sonia/scm/search/SearchHandler.java

 
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableList;
 
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.subject.Subject;
           Collections2.transform(users, function);
 
         result.setSuccess(true);
-        result.setResults(resultCollection);
+        // create a copy of the result collection to reduce memory
+        result.setResults(ImmutableList.copyOf(resultCollection));
         cache.put(queryString, result);
       }
     }