[Android Software/Hacking General [Developers Only]] zeppelinrox:
1. yep

2. The calculation (in ProcessList.java/smali) is to determine the minfree values to put into /sys/module/lowmemorykiller/parameters/minfree

3. All services.jars that I've see for ICS and JB do not use get MEM or ADJ values from build.prop. In fact, the *_MEM values no longer exist in ICS and JB and all have had the minfree calculation in ProcessList.

If a device has a low number of max hidden apps, then many times apps are killed off way before free memory gets low enough for the lowmemorykiller to do anything. So a device with alot of ram and low minfrees will still have over 200mb free because apps are getting killed prematurely due to the app limit.

4. Maybe I can see that samsung services.jar?

5. As noted already... there's no longer any *MEM values to worry about.

6. Yeah.. samsung ICS I must have seen before... but just to be please do post one. Regardless, whatever LMK you put into /sys/module/lowmemorykiller/parameters/minfree is not changed by ActivityManagerServices

7. I got the smali's for the S3 - has the ProcessList math. Also has something else: method public updateHiddenAppNum which circumvents the max hidden apps - I already bypassed that too :p

ehh... no MEM values to worry about.

half baked because there is only half left? lol

Actually there is this routine in AMS.java

public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) {
final long homeAppMem = mProcessList.getMemLevel(ProcessList.HOME_APP_ADJ);
final long hiddenAppMem = mProcessList.getMemLevel(ProcessList.HIDDEN_APP_MIN_ADJ);
outInfo.availMem = Process.getFreeMemory();
outInfo.totalMem = Process.getTotalMemory();
outInfo.threshold = homeAppMem;
outInfo.lowMemory = outInfo.availMem < (homeAppMem + ((hiddenAppMem-homeAppMem)/2));
outInfo.hiddenAppThreshold = hiddenAppMem;
outInfo.secondaryServerThreshold = mProcessList.getMemLevel(
ProcessList.SERVICE_ADJ);
outInfo.visibleAppThreshold = mProcessList.getMemLevel(
ProcessList.VISIBLE_APP_ADJ);
outInfo.foregroundAppThreshold = mProcessList.getMemLevel(
ProcessList.FOREGROUND_APP_ADJ);

But it doesn't effect minfrees and it doesn't even seem to lead anywhere significant.

Setting values for foregroundAppThreshold, visibleAppThreshold etc and they are never mentioned again anywhere else.

Even that calculated lowMemory values isn't used - just do a case sensitive search.

However, just for fun, I can just comment out the appropriate lines in AMS smali code below... heh.

I'd just put a # in front of the lines that start with iput- just to be sure they aren't doing anyting lol

iput-boolean v4, p1, Landroid/app/ActivityManager$MemoryInfo;->lowMemory:Z

.line 5609
iput-wide v0, p1, Landroid/app/ActivityManager$MemoryInfo;->hiddenAppThreshold:J

.line 5610
iget-object v4, p0, Lcom/android/server/am/ActivityManagerService;->mProcessList:Lcom/android/server/am/ProcessList;

const/4 v7, 0x5

invoke-virtual {v4, v7}, Lcom/android/server/am/ProcessList;->getMemLevel(I)J

move-result-wide v7

iput-wide v7, p1, Landroid/app/ActivityManager$MemoryInfo;->secondaryServerThreshold:J

.line 5612
iget-object v4, p0, Lcom/android/server/am/ActivityManagerService;->mProcessList:Lcom/android/server/am/ProcessList;

invoke-virtual {v4, v5}, Lcom/android/server/am/ProcessList;->getMemLevel(I)J

move-result-wide v4

iput-wide v4, p1, Landroid/app/ActivityManager$MemoryInfo;->visibleAppThreshold:J

.line 5614
iget-object v4, p0, Lcom/android/server/am/ActivityManagerService;->mProcessList:Lcom/android/server/am/ProcessList;

invoke-virtual {v4, v6}, Lcom/android/server/am/ProcessList;->getMemLevel(I)J

move-result-wide v4

iput-wide v4, p1, Landroid/app/ActivityManager$MemoryInfo;->foregroundAppThreshold:J