Limit icon loading threads to number of available processors

This commit is contained in:
M66B 2017-12-17 09:25:48 +01:00
parent fe59be7e89
commit d56c629159
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,8 @@ public class AdapterLog extends CursorAdapter {
private InetAddress vpn4 = null;
private InetAddress vpn6 = null;
private ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);
private ExecutorService executor = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors());
public AdapterLog(Context context, Cursor cursor, boolean resolve, boolean organization) {
super(context, cursor, 0);

View File

@ -95,7 +95,8 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> im
private List<Rule> listAll = new ArrayList<>();
private List<Rule> listFiltered = new ArrayList<>();
private ExecutorService executor = Executors.newCachedThreadPool();
private ExecutorService executor = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors());
public static class ViewHolder extends RecyclerView.ViewHolder {
public View view;