Memory settings changes

- Allow allocate up to 1100mb for 32bit (note: not all devices can get to this, so don’t report crash if set too much!)
- Allow allocate more than 4GB for 64bit if free memory is over 4GB.
This commit is contained in:
Duy Tran Khanh
2021-04-30 09:42:56 +07:00
committed by GitHub
parent 3cda62b2df
commit 39a2cd57b2

View File

@@ -48,10 +48,12 @@ public class LauncherPreferenceFragment extends PreferenceFragmentCompat impleme
seek6.setMax(300);
seek6.setSuffix(" %");
long freeMem = Runtime.getRuntime().freeMemory() / 1048576;
CustomSeekBarPreference seek7 = (CustomSeekBarPreference) findPreference("allocation");
seek7.setMin(256);
if(Tools.CURRENT_ARCHITECTURE.contains("32")) seek7.setMax(800);
else seek7.setMax(4096);
if(Tools.CURRENT_ARCHITECTURE.contains("32")) seek7.setMax(1100);
else seek7.setMax(freeMem > 4096 ? freeMem : 4096);
seek7.setValue(LauncherPreferences.PREF_RAM_ALLOCATION);
seek7.setSuffix(" MB");