How to test what's using disk i/o - Testing

I'm getting poor performance, something is hammering the sdcard. But which sdcard? My test phone has 3, 2 internal and 1 removable. The tool 'top' (from Elixir 2) shows iowait is very high. But how can I figure out which app is doing it?

Related

[TIP] Enable swap

After using A2SD to format a swap partition it is not active.
So to enable it, do the following:
Install ROM Manager trough market.
Start ROM Manager and select the first option "Flash ClockworkMod Recovery".
Turn off your device.
Turn on device with volume down pressed.
Press volume down, selection will switch to RECOVERY then press power button.
At the black screen with red triangle press volume up and power button.
Press volume down, selection will switch to Apply sdcard:update.zip and then press power button.
Open a console, navigate to the android SDK tools folder.
Type "adb mount /system", without the quotes doh!
Type "adb shell".
At the shell copy paste the following commands one by one and press enter after pasting them.
echo "#!/system/bin/sh" > /system/etc/init.d/05userinit
echo "swapon -a" >> /system/etc/init.d/05userinit
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
chmod +x /system/etc/init.d/05userinit
chmod g-w /system/etc/init.d/05userinit
chmod o-w /system/etc/init.d/05userinit
chmod g-w /system/etc/fstab
chmod o-w /system/etc/fstab
exit
Now you are back at the normal command prompt, type "adb reboot".
Device will reboot, when its done open a terminal and type "free".
It should show swap space allocated.
And with some programs in memory you can see swap being used:
adb shell
free
total used free shared buffers
Mem: 407860 399940 7920 0 872
Swap: 249596 16596 233000
Total: 657456 416536 240920
Altho it was just using a small bit of swap, this obviously helps.
I was running two benchmarks, had maps open and a radio stream playing.
Quadrant showed my Desire rating at 559 while I was trying to get the phone to actually USE the swap space ...
Btw this is my first Android phone, but I have a rich linux background since 1998. Let's try Android 2.2 as this would boost the benchmark quite notably I recon!
For the most part, swap is not a good idea on Android, because is prevents Androids internal process management from operating efficiently. In some cases, swap can increase performance but in general use it doesn't.
Regards,
DAve
I have to disagree that enabling swap prevents memory management from being effective.
Altho enabling swap "might" degrade the lifetime of your SD card, it still holds memory which is not in use for some time.
You can confirm this by booting up the phone with swap enabled, check the free command and you will notice swap space not being used at all for a fairly long time and even using some applications.
After roughly a day usage, battery is still not empty (Im amazed by this HTC phone!) and swap space is being used by quite abit! Its using over 120mb right now and I still have roughly 10mb free normal memory. Programs still load near instantly and thus tells me swap management works like it should.
To perform a sanity check I started Maps again, free memory dropped to 3mb and some swap was freed. Which confirms that I had not used Maps for the whole day (was sleeping in bed lol) and when it started requested memory which was swapped away and obviously released when it was needed again.
Benchmarks tell me the same story, phone is scoring higher numbers than I tested earlier but this is due to me trying to fill swap during the benchmarks earlier this day. 571 compared to 559, it's not alot but it is "some".
To make a long story short, swap increased performance only when memory is being used too much. Will the performance be noticeable? Probably marginal, but you might notice the difference when your phone has been on for a few days straight. Because the longer you use it, more memory will be used and more unused parts of memory will be swapped.
You might also notice the swap increase when using lots of apps at the same time, mostly using multiple webpages and Maps at the same time.
Some arguments about SD cards being slow, this is only true for writes and not reads.
After further investigation and testing ...
The memory manager from Android could even be optimised for swap.
The current state makes absolutely no use of available swap space, except when memory get filled and then it will start swapping.
In fact it makes TERRIBLE use of swap space ...
You can test this yourself pretty easily yourself. Just open as many applications as you can to fill swap space and leave the phone running for a few hours. If you are like me you are playing with it, testing and/or whatnot you like todo.
After a few hours your swap space will be well filled, in my case around 120mb.
Now I run Advanced Task Killer to kill everything that was running, now swap space used dropped to around 30-40mb and I have almost 100mb free memory ... (free 96924).
Now I reboot the phone and check again after killing all tasks, result is .... rebooting to make an acurate post ... 61528.
So that is roughly 35mb of swapped memory which WAS inuse by Android, HTC Sence and whatnot that was not needed. Ofcourse if the memory would be needed again, it would simple be put back into memory and as this happens alot with lots of applications running.
I can safely conclude that memory management on the Android can be improved by the use of swap ... if it were actually used properly. The only way now is to use a task killer and see your memory increase over time, which is great as my Desire shows absolutely now slow downs or choppyness at all.
On the other hand, testing without swap enabled showed that the memory would increase after bootup too. But not close to 100mb, more like 70mb.
Another point to defeat the point against using swap, the swapped memory is placed on SD and SD write speeds are usualy slow. The slow write speed however does not matter if the memory is not filled already and the to be swapped memory was not inuse for a given time. The other way round when the memory is indeed needed again, SD reads are usualy much faster than writing and as it is such a small amount the read is faster than one would notice.
So when I get time for it, I'll dive into the kernel source. See if we can get a better memory/swap manager going for our already snappy fast phones and make them even faster!
double post :s
sfjuocekr said:
I have to disagree that enabling swap prevents memory management from being effective.
Click to expand...
Click to collapse
If you use swap, you are effectively telling Android you have more memory than you actually have. Therefore, it doesn't reach a memory low condition until you've used up swap, which means it doesn't start killing processes.
Use of swap practically mandates the use of a task killer to kill processes that
Android task management would have usually killed to keep the phone operating smoothly.
Regards,
Dave
You aren't telling Android that you have more memory, there is memory and there is swap.
If Android's process manager doesn't kill processes because it thinks you have more memory, it's clearly stupid as it doesn't know the difference between swap and memory. Besides that both memory and swap are reported independenty.
After 17 hours uptime my phone still holds around 35mb in swap and around 40-50mb free memory, so Androids process/memory manager can clearly be improved to facilitate swap space.
Hi sfjuocekr,
first of all thanks for your little tutorial.
I just wanted to know, that method is still working? I mean on CM7 etc.
And will stay after updating the ROM (e.g. nightlies) or has to be done again every time?
Then, in your case the swap partition was mmcblk0p3, but it's not always like that and should be checked right?

Removing SDCARD for extra battery?!

How about that? How much sdcard consume actually?
Nexus S dont have it, there must be a reason for removing it.
SD cards require ca. 0.15 mA in "standby" or up to nearly 50mA while reading. Therefore, depending on the usage rate of your SD card, it may save power of course to not use one. Instead the data must be read from some other place like internal flash memory. As long as that consumes fewer power, it may be worth a try.
I had this peculiar experience. After reformating my SD CARD I gained 6 hrs of battery life approx now. Previous to the format it was 20 hrs max and now its around 26 hrs. May be the filesystem itself has something to do with power drain I think.
I think I will remove sdcard. My defy now has over 1GB free space and that is enough for everything
ezantera said:
I think I will remove sdcard. My defy now has over 1GB free space and that is enough for everything
Click to expand...
Click to collapse
So how do you compress your 15gb music library into that single GB ?
ill keep my SD card in cheers, removing it cant use any more juice than the internal memory.
My mp3 player, a cowom d2 has internal memory and an sd slot. On sd the play back is way shorter.
Sent from my MB525 using xda premium
On my Sansa Clip+ it makes sod all difference.
Don't use SD card, don't use 3g, keep display low, don't play games, finally sell that phone and be happy.
What would be the point in having it.
Sent from my MB525 using Tapatalk
What's the point of having a smart phone if you don't use its features. Besides wouldn't it consume more time and power if you turn off your device , insert sd card (by some event you need it), turn it on again. ??? Then again, its up to you.
Got a Headache? It's all in your Head.
It does chow battery, thats why I keep most of my apps on the internal flash....and those apps you only open once in a while I leave on my sd, and movies, mp3s etc etc.
You wont need to remove the sd, just unmount it under storage, then it will not even be in standby and save some battery
sg3707 said:
Don't use SD card, don't use 3g, keep display low, don't play games, finally sell that phone and be happy.
What would be the point in having it.
Sent from my MB525 using Tapatalk
Click to expand...
Click to collapse
This argument is not valid in my opinion. Analysing what consumes battery to a more or lesser extent is irrespective of what you use. Once you identified the power hogs, you can alter your use, or accept the consequences for the ones you want to use. If you use a dedicated MP3 player for instance, I could imagine that the internal memory would be sufficient.
For me, 3G is avoided as much as possible. Using wifi instead uses less battery.
nameite said:
It does chow battery, thats why I keep most of my apps on the internal flash....and those apps you only open once in a while I leave on my sd, and movies, mp3s etc etc.
You wont need to remove the sd, just unmount it under storage, then it will not even be in standby and save some battery
Click to expand...
Click to collapse
Thanks man, i did not think of just unmount lol
I could not remove it, my navigation files must be on it... too bad because i dont have need for sdcard since i dont have lots of mp3s and pics. I have now more then 1gb of free space on phone...

[Q] Kernel Frequency Stuck at Max

I am running Jedi ROM, and have tried several different Kernels but they all have the same issue:
The CPU frequency is always stuck at the max frequency.
I have tried adjusting the CPU using both Antutu and Rom Toolbox, but there is no difference.
I need some advice and guidance as to how to fix this.
Some digging around seems to indicate that its an issue with android.process.media from source /system/app/SecMediaProvider.apk
for the first 10 minutes of boot, this goes crazy, and uses insane resources.
Tried killing the task, and after a little bit it turns back on again! AHH
Found the problem. My efforts to FULLY maximize the usage of my note 2, I had installed external high-res textures for n64oid. There are over 7000 files at a size of just under 900mb. It takes a while to go through those.
Option A: deal with it so i can use external textures
Option B: remove the external textures
Option C: go with either A or B and work to find a solution that will make the media scanner totally ignore the folder and all subfolders (.nomedia only applies to the folder it is in, not the subdirectories)

SD card level relative to device temperature?

i dont know the differences among class10 、class6 and class4.
but when i transfer data from PC to my note2 ,i found my device overheated when touching.
i assume it is because the sd card is being written into data that rockets the temprature.
pls do answer my following questiongs. thanks!
1,if i replace a better SD card , would I solve the overheating issue?
2, why is there no USB storage mode when connected my note2 to PC?
3,I use the media MTP mode instead ,which may cause media scanning backstage after transferring data. is it the reason of overheating?(heavily burden of scanning sd card backstage)
USB connection settings are found in. .
menu/settings/development/USB..
I suspect your overheat condition may be battery related. .
SD card changes in higher classes generally increase read/write speeds.
My reason to suspect battery is directly related to charging during data transfer.
A good test would be to power off the device and remove the battery. Then plug in the device and power it on for your data transfer.
If the device runs at an acceptable temperature, the PC may be over charging.
If the device overheats with no battery, then the heat generation resides within the device CPU most likely.
Other means beyond SD cards would need to be taken to reduce heat obviously.
You make no mention of what rom you use, or if you have modified the device kernel with CPU speed changes or voltage adjustments.
All of these factors play heavily into heat generation issues.
More info is needed to be sure of the cause, but the battery removal test will tell you the location to check next....g
thank u for ur reply.
i check the battery temp.
it is 36℃ when transferring.
but when i touch the upper part of phone i feel hot enough.
is it normal?
how could i check CPU temp?
Sent from my GT-N7105 using xda app-developers app

[Q] Speed of internal storage

As my phone is really show (at least 5 seconds for image to display after I press the Camera icon), I tried to measure speed of internal storage via AndroBench application. Just download that app from Play and run the Micro test. My result on Random Write test was only about 0.5 MB/s. I guess this is really too low. I tried LagFix Free app to TRIM the partitions but this didn't help. I have stock 4.2.2 with about 6 months of normal usage.
What are your results? Is the low random write speed indication of something?
marki555 said:
As my phone is really show (at least 5 seconds for image to display after I press the Camera icon), I tried to measure speed of internal storage via AndroBench application. Just download that app from Play and run the Micro test. My result on Random Write test was only about 0.5 MB/s. I guess this is really too low. I tried LagFix Free app to TRIM the partitions but this didn't help. I have stock 4.2.2 with about 6 months of normal usage.
What are your results? Is the low random write speed indication of something?
Click to expand...
Click to collapse
My phone takes around 1 sec for the camera to work. I did the test you requested and my results are:
sequential read 48.8MB/s
sequential write 3.13MB/s
random read 8.62MB/s
random write 0.23MB/s
Keep in mind I'm using 4.4 kit kat on my phone. So your 0.5MB/s is actually good, might want to compare your other results.
I'm pretty sure the internal storage speed has little to do with your camera app launch.
Try setting the SD card as default storage in the camera app.

Categories

Resources