yashsingh1/xdaforums huggingface dataset:
[TouchPad General] DoubleStuff:
free -h VS. running services

[MENTION=8005714]HP_TOUCHPAD[/MENTION] or anybody else who knows about 'free -h' and 'running services'.

( 'running services' is seen by selecting 'developer options' and its on that list )

Before doing my experiment with the LINUX memory command 'top, I thought I would do some pre-testing. So I plugged my HP TOUCHPAD w/Nougat into my PC which has the 'Android Novcom Tool/ADB' loaded.

So at the same time I took a look on Running Services on the Touchpad I also ran the 'free -h' command on the ADB shell. To compare the 2 results. The Touchpad

was just unlocked with no apps running.

And I am confused at the comparison. Even though the total RAM memory from both commands are 828 MB, its seems like the 'free' and 'used' sections are not only different, but alot different.

Can somebody please explain this phenomenon? See attached pic.

readings taken at same time:

Running Services: Total RAM: 828 MB Free RAM: 514 MB Used RAM: 314 MB

free -h on ADB : Total RAM: 828 MB Free RAM: 46 MB Used RAM: 782 MB
[TouchPad General] DoubleStuff:
During my testing Wipe_All always finished with success....but there is something

that can abort the Wipe_All processes, its spelled out in the code, and a warning is given to users, but they would have to look at their PC in the black window.

The code has this comment:

If YOU DO NOT want to Continue, TURN OFF the TABLET NOW

By Pressing the following button at same time

Press and hold POWER plus VOLUME RIGTH ( sic ) KEY and HOME button until it turns off

sleep(10);

***********YOU ONLY HAVE 60 SECONDS STARTING NOW ******

just a FYI to HP_TOUCHPAD he spelled the word RIGHT wrong, not a big deal to me, but if he wants to correct it.
[TouchPad General] HP_TOUCHPAD:
I will reply to every single comment on here with my best answer or opinion, as always.

But I have to finish the MAX settings and post them for all the ROMs, that is taking my time now and I want to have it ready soon!
[TouchPad General] DoubleStuff:
I think HP_TOUCHPAD touched on it a bit when he said this:

...boot Android or CyanogenMod or whatever ( The whatever, is the most important, there could be a ROM with a unique uImage name that could not get deleted ). If after flashing the Automatic_Wipe_All TWRP 3.2.1 ( Recovery ) is not in the moboot menu then it did not finish the process. -HPTP

What HPTP is trying to say is if a file maybe named for example "ThisIsaGreatROM" was put into /boot by a very old ROM process back in the day. It would never get deleted by WipeAll because it does not have an extension ( i.e ThisIsaGreatROM.uImage )

The WipeAll 'remove process' would be aborted at that time, and then not do anymore work, thus WipeAll may then leave other files in /sdCard or /Internal like MiddleRoad said did happen, because the process did not finish because of the error in the /boot directory. This could also happen for something called hidden files like ( .ThisIsaGreatROM ) ( noticed the dot at the beginning ). So my question is now to HP_TOUCHPAD, who I know is working hard on MAX_setting,

Should the WipeAll code remove.sh be changed to my new proposed code?

And if so will that ensure that /boot is totally clean? But then my question is why did the 2nd run of Wipe_all fix middleRoads issue? That is perplexing.

Current Code:

#!/sbin/sh

cd /sbin

rm /boot/*.*

Proposed Code: ( which would force ( -f ) removal of all extension files, regular files and hidden files

#!/sbin/sh

cd /sbin

rm -f /boot/*.*

rm -f /boot/*

rm -f /boot/.*
[TouchPad General] smithylovestouchpad:
Yeah, that is your last chance to abort the Automatic_Wipe_All process. But why would middle_road do that when his intention is to allow the process to finish? And doing what HPTP suggests is a three button process. And I believe if you were to just hold down power and home, that would force the TP to reboot, as long as you did it before his script started to execute there should be not harm done. I'm just still wondering if accidentally touching the screen would have any affect while the Automatic_Wipe_All script is running.

Smithy

---------- Post added at 07:20 PM ---------- Previous post was at 07:14 PM ----------

**************************************************Snip*********************************************************

What HPTP is trying to say is if a file maybe named for example "ThisIsaGreatROM" was put into /boot by a very old ROM process back in the day. It would never get deleted by WipeAll because it does not have an extension ( i.e ThisIsaGreatROM.uImage )

The WipeAll 'remove process' would be aborted at that time, and then not do anymore work, thus WipeAll may then leave other files in /sdCard or /Internal like MiddleRoad said did happen, because the process did not finish because of the error in the /boot directory. This could also happen for something called hidden files like ( .ThisIsaGreatROM ) ( noticed the dot at the beginning ). So my question is now to HP_TOUCHPAD, who I know is working hard on MAX_setting, its in the WipeAll code remove.sh could it be changed from?

**************************************************Snip***************************************************************

I had to go back and check what middle_road said. He does not say that the Automatic_Wipe_All script aborted. Just that there were files left in /boot, including TPTB which is a file with an extension. Keep in mind too, that "ThisIsaGreatROM" would not work because it does not have it's .uImage extension.

Smithy
[TouchPad General] DoubleStuff:
I don't think middle_road aborted the process intentionally, but if you read my previous post while you were typing this post, you will see my answer, and I believe that answer because there is a lot of CSI evidence that the WipeAll processes was aborted due to an error. By middle road's own observation and I quote:

...But there was still data on the SDCard and External from the previous 4.4.4 setup The external SD partition was still showing up with data in it and it was still at the 4GB I had configured it for way back when....

-MiddleRoad

That proved to HP_TOUCHPAD that the wipeAll was aborted due to an error, and the running theory is there was a "rogue" file in the /boot directory, but that being said I think this can be fixed in the code, but lets wait till HP_TOUCHPAD replies

with his advice.

---------- Post added at 01:34 PM ---------- Previous post was at 01:23 PM ----------

Correct "ThisIsaGreatROM" would not show up on /moboot nor would it work, but it could still be in /boot for some odd reason from a rogue developers code.

That being said. If WIPE_ALL did not delete it the first time, I don't think it would delete it on the 2nd or 3rd or even 4th run. Thats why we need HP_TOUCHPAD to chime in, if there was a rogue file in /boot that WIPE_ALL could not delete in the 1st try, why did it work in the 2nd try for middleRoad???

This may go down as a mystery in the same vein as "How many licks does it take to get to the center of a Tootsie pop? Its 364 by the way. Now to get back to 1956 classic "Godzilla King of the Monsters" on Comet TV
[TouchPad General] smithylovestouchpad:
I have another term for mysteries like this, it's called "FM". And BTW, I can devour a TP in 295! :silly:

---------- Post added at 07:48 PM ---------- Previous post was at 07:45 PM ----------

Also, here is what middle_road posted that leads me to believe that the script completed with out aborting:

"Anyway fast forward to last night, I wiped this one.

Has TWRP version 3.2.1-0 on it.

Copied over "Automatic_Wipe_All_and_Create_Android_with_Swap_P artition.zip" to it and rebooted into recovery.

After the orange bar display and it rebooted, I noticed that TP Toolbox was still on the MoBoot menu. Compared to the several times I've run this on other tablets since early this month -"
[TouchPad General] middle_road:
For the record, I didn't touch or press anything during the flashing.

I just set it on it's stand (TouchStone) and executed the script and watched and waited for TWRP to come up so that I could then transfer the required files.

While it was rebooting after the 'Orange Bar' screen is when I noticed the menu items still present.

I just let it continue into recovery and didn't press anything.

After it booted into TWRP was when I noticed there were 'leftovers'

I believe this HPTP is just flaky and misbehaving. It was locked up this morning after I took it off it's Touchstone.

I wonder if something is giving out or failing on it. (going to try to re-do it today if I have the time.)

Then it also could just be some electronic Gremlins running around giving me grief, they tend to get into a lot of my stuff.

Back when it was first setup for 4.4.4 I may have messed up something in /boot - it's possible.

I usually add a 'moboot.timeout' in order to give me 10 seconds to make my choice.

Who knows what else I may have copied into /boot inadvertently (user-error).

I normally only perform NAndroid backups on our phones, very rarely on my TP's, anything critical on the TP's

I copy over to either my 'Nix or Windoze servers which allows me to nuke/wipe whenever I want to.

This is probably just an odd occurrence that was easily remedied by executing the script a second time.

Let [MENTION=8005714]HP_TOUCHPAD[/MENTION] concentrate on his 'MAX settings' efforts and not get sidelined by this oddball of mine.

If someone else has some sort of difficulty or odd occurrence perhaps the quick solution is to just run the 'Wipe All' script a second time.
[TouchPad General] smithylovestouchpad:
Now we know that an inadvertent touch or key press was not the issue.

Remember what DoubleStuff figured out, anything with an extension should get deleted. That is what his tests showed. So moboot.timeout should be deleted. I also use moboot.timeout and a for looks. Moboot.background.tga.

Smithy
[TouchPad General] kojam:
Silly question. Do I have to repeat the entire flash sequence in the specific order outline in the original post, or can I just flash now?

---------- Post added at 06:07 PM ---------- Previous post was at 05:40 PM ----------

Argggggggggggggggg!

Had just written a whole paragraph about my experience but accidentally hit something here on my super sensitive phone and lost it all!!

In a nutshell. After reading this...decided to do the entire thing again.

Noticed that when I click on the wipe file, there's a message that says to move the wipe file to the "/acct" folder before wiping, reboot, then selecting that wipe zip file from "/acct".

I did move the file there so many times, but it was nowhere to be found after rebooting (before wiping). WTH?! WHERE IS IT?! WHAT HAPPENS TO IT?!

I had to push it back the touchpad with adb several times because I cannot find it.

The TP runs beautifully now with one minor annoying popup error once in awhile, but I wanna repeat the process one more time to make sure. It's liveable. I cannot communicate with Play Store still to setup my account but that's insignificant, as i have a myriad of diff ways to get apk-s installed. I'm not going to install more than 10 apps on it.
[TouchPad General] HP_TOUCHPAD:
You are using the first version of Wipe_All, that has been removed completely and replace with the Automatic_Wipe_All. I do not know where you are getting that obsolete file.

I do not know how many times I have to keep posting the same over and over:

READ THE FIRST PAGE OF THIS GUIDE FOR ALL THE CURRENT FLASH ZIP FILES.
[TouchPad General] middle_road:
It would be best to try it from scratch.

[MENTION=8005714]HP_TOUCHPAD[/MENTION] is tweaking and improving this method frequently and updates the files as needed.

I made the same mistake back on the 4th of September. I inadvertently used a file from back in July.

I deleted everything in my working directory and went back through the first post and downloaded everything 'fresh'.

It doesn't take that much time and then you'll know that you have the most recent versions.

Which ROM are you Flashing?
[TouchPad General] HP_TOUCHPAD:
The following zip flash files can be flash once the Tablet has been set up with a swap partition.

HpTp_Universal_Optimize_Swap ( Settings applied to: Ramdisk and build.prop ) use as a laptop

HpTp_MAX_Universal_Optimize_Swap ( Settings applied to: Kernel, Ramdisk and build.prop ) use as a laptop

Original_Settings_Swap_Disabled ( Stock ROM settings )use as a smartphone

At any time any of those flash files can be flash to run the Tablet differently.

After flashing using TWRP Recovery only Wipe:

Dalvik /Art Cache

Cache

and Reboot, it may take two reboots for Android to applied all settings.
[TouchPad General] middle_road:
You think you're confused? I'm right there with you. :D

Doesn't make any logical sense, but that's always been the case with computing devices.

Check this out. Tablet connected via USB with Terminal Emulator running on the tablet. On PIE.

ADB shell

"free -h" returns:

shell@tenderloin:/ $ free -h

total used free shared buffers
Mem: 828M 740M 88M 0 4.7M
-/+ buffers/cache: 735M 92M
Swap: 504M 17M 487M

In the Terminal Emualator on the tablet 'free -h' returns:

total used free shared buffers
Mem: 828M 747M 81M 0 4.6M
-/+ buffers/cache: 742M 86M
Swap: 504M 16M 488M

And then I go into 'Running Services' (and then can't capture the screen. It activates but the filesize is -0-. (go figure))

Anyway Running 'Services' reports.

System: 323MB

Apps: 120MB

Free: 425MB

So, three different answers here and there is a vast difference between command line and Running Services.

(Is it 5 o'clock yet? Somewhere? :brewtime: )

...

..

.
[TouchPad General] kojam:
I've only ever downloaded all the files from there the links on the 1st page.

I don't know how/where I got that from. Strange! I will delete all files I have related to this and start from scratch. So strange how I got that file!

Maybe i need to clear all my cookies and history on my computer as well and start over.

Thanks!
[TouchPad General] DoubleStuff:
Without a screen capture I question your numbers on 'Running Services' because they don't even add up to 828 MB, at least all my numbers added up to 828 MB, so check if you had a typo. Anyway I am no too worried about the small differences between the Terminal Emulator on the HP TOUCHPAD and the LINUX server with HP TOUCHPAD plugged in. But I believe [MENTION=8005714]HP_TOUCHPAD[/MENTION] will set us straight on why running services is so different on "used" and "free" memory than the "free -h" command on Terminal Emulator. ( Of course when he is done with MAX Settings ). Then I want to start my experiments with all the new settings. As per the screen capture, on Nougat all I have to do is "long press" the power button and then a menu comes up with ( Power Off, Restart, Screenshot and Airplane Mode ), then I select the one I want. Not sure why your screen capture is zero size, you have been having alot of mysteries as of late....maybe you have to start cutting back on the brew!!! LOL
[TouchPad General] middle_road:
Still can't upload images to XDA so I went and signed up for MF...

Here are a set of screenies after I rebooted the tablet and re-did the whole exercise...

Screw it, can't attach anything for some d*mn reason... *GADS*

Here's a -=-LINK-=- to mediafire

Anyway, I don't see 'Running Services' adding up to 828MB no matter what.

Tablet isn't saving screenies. I can share one via Hangouts but otherwise the filesize in the Screenshots folder is -0-.

I included some screenies of my failed attachments FWIW.

Talk about bloody frustrating....! (Time for some shooters to go with the Brews...)

Trying from XDA App

(back on desktop, and the App was a nogo also for attaching. "Bad Request: Upload of file failed."
[TouchPad General] DoubleStuff:
Your right your Running Services is adding up to 867 MG and your free -h is 828 MG

not sure why that is happening. But your first order of business should be fixing

your zero byte screenshots, and your uploads to XDA, these are important as a tester and journeyman, they way things are going for you now it would not hurt to stick to the 12 oz cans. :)
[TouchPad General] middle_road:
Local Brew Haus has (5)Liter Mini Kegs. I wonder if I can get Honey to go pick me up one... :cool:

EDIT:

So I figured I'd try logging in under another browser with a different Google account to see if attachments would work. er, I forgot about the (10) post rule.

So here's three screenies from my other tablet (WT) that is Running a fresh install of EV9.

868MB under 'Running Services' and it's chewing up a lot more RAM.

292MB Free vs. 330MB free on the one above. (Before a reboot.)

After Reboot it's: 340MB Free on (WT)

-=- LINK -=-
[TouchPad General] DoubleStuff:
Well I will not be using "Running Services" for my future experiments because I want a live look at memory when starting and ending user apps and such. So

I will be studying "free -h" and "top" among other things until [MENTION=8005714]HP_TOUCHPAD[/MENTION] gets back to us on this, but I found the below link helpful in explaining things. But also remember that the 'free' command is just grabbing information from this file /proc/meminfo. So you can run this command on Linux or Touchpad to get the full picture:

cat /proc/meminfo | more

also when we start getting into TOP command later, the following command

ps aux --sort -rss supposedly is "better" than TOP, because TOP can also give hard to understand results for newbies in memory, like me )

Understanding LINUX memory I

The key in part II is that if you look at the contents of /proc/meminfo using 'cat /proc/meminfo' notice these two lines:

Slab: XXXX kB

SReclaimable: YYYY kB

Almost (XXXX+YYYY) kB of memory is in use by the kernel slab memory structures – but almost all of that memory is reclaimable. (Or, in effect, free.)

Understanding LINUX memory II
[TouchPad General] middle_road:
Good Links! Decent info there.

Something is really odd with 'free -h'

I just nuked/wiped another tablet here (GDot) and installed Pie. And the results are weird.

First boot up:

'Running Services' reports: ~ 375/191/302

while 'free -h' reported:

u0_a49@android:/ $ free -h
total used free shared buffers
Mem: 828M 744M 83M 0 1.4M
-/+ buffers/cache: 743M 85M
Swap: 504M 38M 466M
=====================================================================
u0_a49@android:/ $ free -h
total used free shared buffers
Mem: 828M 756M 72M 0 1.2M
-/+ buffers/cache: 755M 73M
Swap: 504M 97M 407M
=====================================================================
u0_a49@android:/ $ free -h
total used free shared buffers
Mem: 828M 752M 76M 0 1.3M
-/+ buffers/cache: 750M 77M
Swap: 504M 97M 407M

After a Reboot:

'Running Services' reports: ~299/181/388 after 10 mins: ~299/194/374

Free -h and meminfo show:

u0_a49@android:/ $ free -h
total used free shared buffers
Mem: 828M 748M 79M 0 5.0M
-/+ buffers/cache: 743M 84M
Swap: 504M 12M 492M

u0_a49@android:/ $ cat /proc/meminfo
MemTotal: 847396 kB
MemFree: 88992 kB
Buffers: 5432 kB
Cached: 338004 kB
SwapCached: 11080 kB
Active: 281348 kB
Inactive: 299140 kB
Active(anon): 141612 kB
Inactive(anon): 155296 kB
Active(file): 139736 kB
Inactive(file): 143844 kB
Unevictable: 59132 kB
Mlocked: 54376 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 847396 kB
LowFree: 88992 kB
SwapTotal: 516092 kB
SwapFree: 502256 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 285912 kB
Mapped: 211736 kB
Shmem: 740 kB
Slab: 29328 kB
SReclaimable: 7700 kB
SUnreclaim: 21628 kB
KernelStack: 6864 kB
PageTables: 19520 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 939788 kB
Committed_AS: 14659092 kB
VmallocTotal: 1040384 kB
VmallocUsed: 106412 kB
VmallocChunk: 785412 kB
u0_a49@android:/ $

And after ~10 mins they were about the same...

Talk about confused.

I'm missing something here for sure. ~358 vs. ~82?

Going to wait and check tomorrow. do a few more reboots ...
[TouchPad General] DoubleStuff:
note you can use free -k to match the units used by /proc/meminfo which is KBs

Take a look at the my attached meminfo pic, in your case the total FREE memory would be

MemFree: 88992 kB

+

Buffers: 5432 kB

+

Cached: 338004 kB

+

Slab: 29328 kB

+

SReclaimable: 7700 kB

Because from what I can gather from those LINKS is that in LINUX free memory is the addition

of the above fields of memory.....

Total these fields and divide by 1024 to get back to MB

according to above 5 memory numbers I calculate your FREE memory as

458 MB ( using /proc/meminfo ) vs. 374 MB ( using running services ), so we are getting closer to equality
[TouchPad General] middle_road:
I like how you laid that out - makes sense.

And if you take only Buffers + Cache you end up with ~448MB which is close to the 443MB that 'Running Services' is reporting.

My latest nuke/wipe of EV9 on tablet (GDot) doesn't seem good. Hangouts and Root Explorer keep FC'ing and every so often 'System UI' pops up.

Hangouts won't even come up, it just crashes back to the main screen.

I flashed it [MENTION=6842571]1782[/MENTION] then backed it off with a flash of 1674, no difference.

Going to re-wipe here in a bit. Debating if I should try DU8 this time around. Haven't tried that one yet.

EV9 install on Tablet (WT) is doing well with only an occasional 'System UI' popping up.

JCS's 11 is doing nice on (Blue), haven't gotten around to trying out all my video apps yet though.

Batteries are behaving across the board.

I'm starting to wonder if I've just plain worn out my Tablets...
[TouchPad General] anonxlg:
i'm installing Evervolv Pie and I'm getting an error after flashing upon boot. Invalid boot image.

I tried copying the boot.img (from the rom zip) -> rename to uImage.Android -> copy to /boot, but I get an error 1

-edit-

the problem might be because there's not enough space in /boot? the boot.img in 7.1.2 is 5.5mb and the 9.0 one is 7mb

it could be some permission issue too, I can't seem to copy the /boot dir to internal storage to debug if it's space issue

on twrp 3.2.1.0
[TouchPad General] middle_road:
You'll probably need to start from scratch.

In all the ones I've done lately I have not had that problem (Knock On Wood...)

- Which version of TWRP are you using?

- Boot up into Recovery (TWRP).

- Copy "Automatic_Wipe_All_and_Create_Android_with_Swap_Partition.zip" onto the device.

- Install it with TWRP.

- Wait for it to execute and reboot

It will (should) come back up in TWRP

- Copy over the ROM File +

the 'Universal Optimize Swap' file(s) for EV9 +

the 'ROM_Reducer_Evervolv_v9_elginsk8r_Pie.zip' +

open_gapps-arm-9.0-pico-201909xx.zip (if desired) +

SR5-SuperSU-v2.82-SR5-20171001224502.zip

and Flash those as per the instruction shown on Post #1 of this thread.

...

..

.
[TouchPad General] DoubleStuff:
Well you have to add Free to that for sure, so FREE + BUFFERS + CACHE = TOTAL FREE MEMORY, and in our cases it just a little more than 'RUNNING SERVICES' FREE memory, good enough for my experiments.

and maybe we can ignore Slab and SReclaimable because they are in use by the Kernel, see a snipped

from my LINK II below, and maybe for the HP TOUCHPAD kernel memory is not reclaimable....

Looking at the contents of /proc/meminfo showed these two lines:

Slab: XX kB

SReclaimable: YY kB

So – (XX+YY ) kB of memory is in use by the kernel slab memory structures – but almost all of that memory is reclaimable. (Or, in effect, free.)

Now in my next experiment I am going to add up the RSS column from the command TOP and that should equal "USED MEMORY" from free -h, and running services.
[TouchPad General] middle_road:
I took the easy way out. Played 'match the numbers' is all. :cool:

I'd liked to dig into it to the level you are, but I just don't have the time (or energy).

After a wipe, I flashed DU-v12.5.3 onto the troublesome tablet (GDot).

It's working pretty well so far. Going to dink around with it a bit more later tonight.

Nothing is 'Force Closing' but the 'System UI' message has popped up a couple of times.

Hangouts is running fine. It is the app I use to chat with my kids.

I should keep a proper set of notes, however . . . Too many tablets/toys - not enough free time.

My Nexus7 went belly up on me and I tried flashing PureNexus on it and it isn't functioning right - drat.