[HOW TO][SCRIPT] Swap - Gen9 Android Development

I've made a simple script that activates swap on boot
What is swap?
Swap puts the 'less important RAM' on the sdcard, making the device faster. It is best when used with v6 Supercharger. (See my other thread)
Requirements:
An SD card to BE IN THE DEVICE AT BOOT, POSSIBLY EVERY BOOT, with at least 150mb of space free on it
A 8/16gb Archos G9 (NOT THE 250GB MODEL)
Root
Script Manager from the market
Busybox (See my other thread)
What to do:
1. Download this: (long press > save link)
http://db.tt/LP7tliLZ
2. Using Script Manager, locate the downloaded file and rename (long press > rename) to 90swapon.sh
3. Copy (long press > copy) it to /data and then tap it to bring up a pop up window
4. Tap the little "pirate flag" (superuser logo) and the "gear" (run on boot)
5. Tap run and wait for it to say swap is on
6. Reboot
7. Hit thanks, you are done
Note: to check if it works, type "free" into a terminal, and it will give you values for swap. It takes a bit to kick in, so it won't be on straight away on boot
Sent from my ARCHOS 80G9 using xda premium

thank you for this and all the stuff you did/contribute for our G9

jipee296 said:
thank you for this and all the stuff you did/contribute for our G9
Click to expand...
Click to collapse
I actually do most of this stuff for myself and then upload it for the community, but thanks
Sent from my ARCHOS 80G9 using xda premium

Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?

jipee296 said:
Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?
Click to expand...
Click to collapse
Don't have that issue. It's not to do with swap
Sent from my ARCHOS 80G9 using Tapatalk HD

gorymp mine
Hi, thanks for that job, I'm going to try it!
But I have one question:
Why, if the G9 recongnizes de main memory as SD, is not posible to do that with the main memory instead of an external card??
I prefer to lose even 1Gb on my memory for increasing my perfomance...

Denkel said:
Why, if the G9 recongnizes de main memory as SD, is not posible to do that with the main memory instead of an external card??
Click to expand...
Click to collapse
First of all, because the swap is continuously rewritten as the system tries to distribute itself between physical RAM and swap in the optimal way. Any type of flash memory allows only a limited number of read-write cycles - and not really big. So, if you put swap onto it, you will kill it in a relatively short time . If it is a card, you just replace it; if it is the main ROM, you ruin the entire device.
Аnd once the swap volume is corrupt, results are unpredictable - that is what might happen to jipee296. jipee296, did you use an old card that had been rewritten many times before? Try a brand new one just to see if the problem goes away.
HDDs do not have this limitation, so if it were the HDD model, there would be the perfect place for swap. But this is not the case.
Quinny899, will the system start at all if swap is activated but the card is missing or corrupt? Actually there are two more inctructions missing for a complete solution: how to replace the SD card (will the swap be re-built automatically on a new card?) and how to remove swap completely. Any new step should be repeatable and reversible.
BTW, does someone know the exact brand of SD card reader used in G9 (hopefully it is the same in all models), or at least its performance characteristics (class, read spped, write speed)? This would be helpful to choose the optimal SD - as fast as the controller can support, but not an even more fast and more expensive one.

iourine said:
First of all, because the swap is continuously rewritten as the system tries to distribute itself between physical RAM and swap in the optimal way. Any type of flash memory allows only a limited number of read-write cycles - and not really big. So, if you put swap onto it, you will kill it in a relatively short time . If it is a card, you just replace it; if it is the main ROM, you ruin the entire device.
Аnd once the swap volume is corrupt, results are unpredictable - that is what might happen to jipee296. jipee296, did you use an old card that had been rewritten many times before? Try a brand new one just to see if the problem goes away.
HDDs do not have this limitation, so if it were the HDD model, there would be the perfect place for swap. But this is not the case.
Quinny899, will the system start at all if swap is activated but the card is missing or corrupt? Actually there are two more inctructions missing for a complete solution: how to replace the SD card (will the swap be re-built automatically on a new card?) and how to remove swap completely. Any new step should be repeatable and reversible.
BTW, does someone know the exact brand of SD card reader used in G9 (hopefully it is the same in all models), or at least its performance characteristics (class, read spped, write speed)? This would be helpful to choose the optimal SD - as fast as the controller can support, but not an even more fast and more expensive one.
Click to expand...
Click to collapse
To remove just delete the file you pushed. And I ran swap on my old phone for 2 years and nothing happened to the sd
Sent from my HTC Desire HD using XDA Premium HD app

jipee296 said:
Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?
Click to expand...
Click to collapse
I didn't try the script yet but used "swapper 2". I assume this does the same thing and I get random reboots and freezes too. I tried different values for swappiness, internal memory or sdcard, swap file and swap partition, the problem remains

SE-X1 said:
I didn't try the script yet but used "swapper 2". I assume this does the same thing and I get random reboots and freezes too. I tried different values for swappiness, internal memory or sdcard, swap file and swap partition, the problem remains
Click to expand...
Click to collapse
Swapper 2 has freezing issues, the script doesn't
Sent from my Desire HD using XDA Premium HD app

Hi,
I looked at your script and it seems to recreate the swap file at every boot. That might slow the boot process. You could add an "if file exists...don't rm and create" kind of instruction...

Quinny899 said:
To remove just delete the file you pushed.
Click to expand...
Click to collapse
And what happens next? Does the system start at all? Does it re-create the swap, or operates without swap from that point on? (Sorry, I'm on the go now and cannot investogate your script.)
And I ran swap on my old phone for 2 years and nothing happened to the sd
Click to expand...
Click to collapse
Well, to say not so categorically - this may depend upon many things: memory type, manufacturer, actual load, etc. E.g. if the amount of physical RAM is sufficient for everyday use, then swap is used very rarely, or not used at all - surely, the card will live much longer in this case. Yet finally any flash memory is mortal, sooner or later (like us, too). I personally had a few dead cards and sticks over the past few years (without swap, just due to intensive usage), and I won't risk the entire device for the price of a flash card.

x3ss said:
Hi,
I looked at your script and it seems to recreate the swap file at every boot. That might slow the boot process. You could add an "if file exists...don't rm and create" kind of instruction...
Click to expand...
Click to collapse
I'll look into it
Sent from my Desire HD using XDA Premium HD app

iourine said:
And what happens next? Does the system start at all? Does it re-create the swap, or operates without swap from that point on? (Sorry, I'm on the go now and cannot investogate your script.)
Well, to say not so categorically - this may depend upon many things: memory type, manufacturer, actual load, etc. E.g. if the amount of physical RAM is sufficient for everyday use, then swap is used very rarely, or not used at all - surely, the card will live much longer in this case. Yet finally any flash memory is mortal, sooner or later (like us, too). I personally had a few dead cards and sticks over the past few years (without swap, just due to intensive usage), and I won't risk the entire device for the price of a flash card.
Click to expand...
Click to collapse
If you delete it it just doesn't use the swap file. End of.
And why, if swap was unsafe, do almost all Linux builds recommend it and HTC incorporate it on some phones?
Sent from my Desire HD using XDA Premium HD app

iourine said:
Yet finally any flash memory is mortal, sooner or later (like us, too). I personally had a few dead cards and sticks over the past few years (without swap, just due to intensive usage), and I won't risk the entire device for the price of a flash card.
Click to expand...
Click to collapse
I still use Kingston 8GB micro sd card- it had 128MB swap partition used from the very beginning I bought it (samsuck Spica had 256MB ram, it was quite hard to use it without swap)- card still works fine, no r/w problems on swap area.
On the other hand- if you don't like swap on flash memory you are free to make zram driver

Quinny899 said:
If you delete it it just doesn't use the swap file. End of.
Click to expand...
Click to collapse
Ok, now it is more clear.
And why, if swap was unsafe, do almost all Linux builds recommend it and HTC incorporate it on some phones?
Click to expand...
Click to collapse
Because all end-user Linux distributions arу traditionally targeted at conventional PCs equipped with a HDD. Things are different, say, for embedded Linux projects - swap is a very rare thing there.
In fact, swap concept is a thing of the past. Physical ROM is rather cheap now, and there are very few reasons to have it less than needed for your everyday use. Provided that, you can eliminate swap at all, both for Windows, Linux, or whatever else. I did this a few years ago (with RAM ranging from 1,25GB at my very old travel notebook to 8GB at graphic station used to stitch multi-megapixel panoramas), and never was short of RAM.
Unfortunately, this is not the case for current G9 8-(( A few bucks saved on a RAM chip by Archos designers cause problems now and will definitely cause much more problems in the future. I would never buy it if I only knew that there is only 512MB. I just missed the fact that RAM is not listed in technical specifications because I could not imagine that the very top model, the newest one, with high-end other hardware, may be below the de-facto standard of 1GB. That is why swap is really important for us here and now.
As for HTC, they might have various reasons to do so... not only the technical ones...

Hello, you can not increase the size of the swap file more than 150mb?

brbi said:
Hello, you can not increase the size of the swap file more than 150mb?
Click to expand...
Click to collapse
Modify the file. 150 should be all you need though. It will also take longer to boot the higher you make it
Sent from my Desire HD using XDA Premium HD app

Related

[SOLVED] Apps2SD problem with sd

I had apps2sd by lucidrem running on my phone and it was fine. I was out today and my sd card was 'removed' although I didn't touch it. This ended up bricking my phone, because the sd is removed and there is no data or delvik etc. Is there a method to use apps2sd without it being permanently affected when an sd is removed?
A reinstall of rom has fixed it however I have lost everything off the phone now
Thanks
Tucka
LucidRem's Apps2SD uses symlinks which I believe is now preferred over the one used by MarcusMaximus (forgot what its called ) only way to remove a sdcard safely without screwing up your phone is if the phone is turned off. No idea how the sdcard was 'removed' if you didn't touch it. Happened sometimes to me, but never found out what caused it. Hope this helps.
Best to apply Apps2SD again really or use a ROM that automatically enables it by default if a partition exists (Cyanogen/Dude).
Also a small sidenote... The term "brick" means your device would no longer be functional at all, I.E Unable to turn it on using any method. A more suitable term would probably be "crashed" instead.
I only mention this because the term bricked is being used far too loosely to describe the wrong symptoms.
Sorry for loosing brick loosly, just presumed that was what it was when the phone won't get past the G1 splash. So, say I want to watch a movie or something on a different memory card (won't be able to fit all my stuff on one) all I have to do is switch phone off, remove memory card, insert different one (preferably also with a2sd configured for meridian video?) and that will work?
I think the problem is with movement and sudden knocks that the card comes out. I was running through a storm when it said memory card was removed.
Thanks
No worries about the terms as there are an awful lot of them in the world of technology! Long as we're all learning then we can't argue ^_^
To be honest, hot swapping SD cards is a bit long winded... Its best to save up and invest in a larger memory card if possible (Class 6). Not sure what size your SD card is, but if it can't hold a movie then it could be time to buy a new one.
Also if you use the older Apps2SD program (1.1 I believe) it uses Symlinks as alritewhadeva mentioned and it shouldn't cause your phone to crash totally if the SD card is removed.
Best solution though is to buy a new SD card, you should be able to find one on the cheap on the net.
its an 8gb C4, however I am travelling and will be on a 10 hour flight later this month, and was wanting lots of films and tv shows etc. May just compress and squeeze them onto my 8GB.
Thanks a lot
Tucka
using a2sd and 2 memory cards doesnt work. All your app data and cache is on your sd card and the phone wont be able to boot without the right sd card in the phone (trust me i have tried). I suggest buying a new card maybe 16 gb.
Hope they have a charging point on your flight! It would kill your battery watching a movie for that long haha. Better off with an iPod/MP3 player I reckon.
But yeah, you can either add more compression or reduce the resolution/framerate to fit more on your SD card. Quality will drop but at least it will keep you entertained.
2 batteries plus a portable battery charger ftw
Haha, that should be sufficient then! Very well prepared ^_^ I was thinking about getting one of those wind up backup chargers for emergancy use once... No idea if its any good.
If everything is sorted tuka, could you please edit the title to add "[SOLVED]" so people know? Thanks!

The Effects of CompCaching?

I was just wondering, since using a Linux Swap over time wears down your SD card, doesn't using a CompCache wear down your internal memory.. which is just as bad if not worse?
SolemnWishing said:
I was just wondering, since using a Linux Swap over time wears down your SD card, doesn't using a CompCache wear down your internal memory.. which is just as bad if not worse?
Click to expand...
Click to collapse
Compcache doesn't use internal memory but the phone's RAM, two different things, don't get them confused. Like the RAM in your computer, it doesn't have a limit two how many times it can be written to or read from. So its "healthier" for your phone. But its results are mixed, some see a huge improvement, some see none, some see their phones slow down. Its worth a try as its only one userinit.sh from being used. Not a huge ordeal, if it doesn't work, delete the script and just reboot your phone and you're back to just linux-swap.

Use internal memory to have more RAM space

Hello everybody
First, plz excuse my very bad english..
I would like to know if its possible, and if yes, how, to use internal memory to make the same thing than a swap linux partition, but on the phone memory, not on SD
I would like to know if there is a tutorial or anythings that speak about this..
It could be very interesting to save SD card life and i don't care about to loose memory for my apps
Thx for Help
Fabulous, speaking for a few members of Smartphone France community
I thought about this myself (putting swap partition on internal storage), since it should be faster.
After thinking for a while though I realised that wearing out an SD card is one thing, destroying the internal flash is far worse.
even with a swap partition on your phone the sdcard will still last around 2 and a half years. i thought people had quit this about sdcard life. My sdcard will probably be around then my phone.
besides when the sdcard doesn't just die on day. the "dead parts" parts of the sdcard will just no longer be used. meaning there will be less overall storage space on the card but it will still function
I don't think that's a particularly good idea. The sd card might stay longer with you than your phone, but if your phone's internal memory breaks you can't just shrug and buy a new one.
That said, if you're set on doing this, you could probably put a swap file in /cache. Without OTA updates that doesn't get used for much anyway.
Afirejar said:
I don't think that's a particularly good idea. The sd card might stay longer with you than your phone, but if your phone's internal memory breaks you can't just shrug and buy a new one.
That said, if you're set on doing this, you could probably put a swap file in /cache. Without OTA updates that doesn't get used for much anyway.
Click to expand...
Click to collapse
i wasn't suggesting what the OP said, i have a linux-swap partition, i was simply that the card will most likely last longer than the phone but why ruin internal phone memory, that would make it unusable. I agree that you should put the swap file on the sdcard
is it possible ? yes
but like everyones sayd just don't do it , you might break your phone very fast and you won't gain any significant speed either
a class 6 card is about the same speed as internal storage and theyre relatively cheap now
Even if you could it probably wouldn't be worth it and there is already a very limited amount of memory in the phone. It would be safer for the phone and you would be able to have a larger swap file by using the sdcard.
If you are dead set on it, about 5 minutes of googling didn't turn up any howto's on making the swap on the system memory but here are a couple howto's one is the linux swap file and the other is adding the swap to the sdcard. The instructions shouldn't be hard to adapt for the main system flash memory
http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
http://androidcommunity.com/forums/f8/adding-swap-space-ram-to-g1-16325/
i still don't understand why people insist on using sdcard for swap space. It'd make sense if the sdcard were used exclusively for swap, but with all the r/w operations going on (app read, media read/write, and swap read/write), not even a class 6 card provides enough bandwidth for doing swap operations effectively... I'm with cyan on this one, and a good compcache setup is the best choice atm.
jubeh said:
i still don't understand why people insist on using sdcard for swap space. It'd make sense if the sdcard were used exclusively for swap, but with all the r/w operations going on (app read, media read/write, and swap read/write), not even a class 6 card provides enough bandwidth for doing swap operations effectively... I'm with cyan on this one, and a good compcache setup is the best choice atm.
Click to expand...
Click to collapse
I have around 15-20 mb free internal memory when using cyanogen rom but around 1 to 2 mb free when using hero rom
sd swap use around 50 mb on hero rom with swapiness at 70%
you absolutly need to swap in hero rom
samygent said:
I have around 15-20 mb free internal memory when using cyanogen rom but around 1 to 2 mb free when using hero rom
sd swap use around 50 mb on hero rom with swapiness at 70%
you absolutly need to swap in hero rom
Click to expand...
Click to collapse
If Apps2SD is running correctly you should have 89mb free on Cyanogen and about 50-70mb on Hero :-S
AdrianK said:
If Apps2SD is running correctly you should have 89mb free on Cyanogen and about 50-70mb on Hero :-S
Click to expand...
Click to collapse
apps2d doesn't have anything to do with swap partition or does it ?
# free
free
total used free shared buffers
Mem: 97860 95896 1964 0 360
Swap: 104412 57060 47352
Total: 202272 152956 49316
#
swapiness at 70 and everything run's very smoothly
edit : yah i love tabulation
increase ram
Fabulous691 said:
Hello everybody
First, plz excuse my very bad english..
I would like to know if its possible, and if yes, how, to use internal memory to make the same thing than a swap linux partition, but on the phone memory, not on SD
I would like to know if there is a tutorial or anythings that speak about this..
It could be very interesting to save SD card life and i don't care about to loose memory for my apps
Thx for Help
Fabulous, speaking for a few members of Smartphone France community
Click to expand...
Click to collapse
please tell me how to convert internal memory into ram. I will be very thankfull to you

basic enthusiast questions

i got a few questions...
1) i have on average 36m of available memory, is this normal? i got task manager app and seem to be at my optimization limit..
2) im on stock 1.5 now, what is the fastest and most efficient firmware out now that reduces the bloat and optimizes the phone, and how do i put it on the phone
3) what else can you do with the usb cable, is there a 3rd party android client for pc or something like that? anything interesting like that
thanks
1) I assume you mean 36 MB of RAM available? Not internal memory? If so, yes that is actually very good, I average less than 25 and tend to stay under 20 MB
2) There are ROMs on the G1 going all the way up to 2.2, I for one have chosen to stick to 1.6 because, I know many people will disagree with me on this, but I simply just believe the G1's hardware wasn't really meant to go anywhere above 1.6. 2.2 and anything above 1.6 in my opinion is a bit too slow and cumbersome for me. I believe you should make the move to 1.6, maybe SuperD which is what I have been using for half a year now. 1.6 more closely integrates the search function and search tools, when you upgrade to 1.6 you will quickly see what I mean by that and it tends to cause a bit of lag and takes a large chunk of memory, though it is more convenient.
3) Well... you can use it for ADB (Android Debug Bridge). You can use it with Android ScreenCast, which is a program that allows you to use your G1 from your computer as long as it is connected to your phone, you can see whats on the screen, click, etc.
------------------
In continuation of 2:
I don't know if you have rooted your phone or not, but you will definitely need to do that first. Find instruction for that, there are only like a couple dozen threads telling how on XDA.
Find your ROM, again I recommend a 1.6 ROM, but feel free to give 2.2 a try and see if you like it. Install it, do be careful and read the instructions very carefully, especially when it comes to flashing a new radio image, you can brick your phone rendering it unusable.
So just look those things up, follow instructions carefully, reread everything in the instructions before doing anything and of course, in the case you do mess up, I can't be held responsible, I just provided you with a start. Best of luck!
there was an update to 1.6 so im on 1.6 now
since the g1 appears to have a limited amount of ram, is apps2sd worth it, say if i get a class 6 sd card of newegg, how difficult is it to install apps to the sd, and what is the performance
will the sd card deteriorate over time and lose performance?
i just want to put together the most efficient longest lasting setup
btw my i was checking my ram i guess through the task manager app, my free internal memory is like 50+mb..i dont see the point of an sd card if its not even being used, so running apps off the sd is what interests me, i dont have much other reasons to root
RAM really doesn't have that much to do with Apps2SD. I believe you should go ahead with the Apps2SD, but it really depends on how many applications you have. If you have anymore than 30 or so applications, you should go with Apps2SD. I for one am not certain about the effects of low internal memory, except that it gives you an alert every once in a while. My phone has "grown up" with Apps2SD from the start, so I don't have much experience on how a phone runs without it. The thing with Apps2SD is that it might be a hair slower than storing in internal memory, but that is a given. I use a Class 4 SD card and it still runs really nicely, a Class 6 SD card should definitely be good.
The lifetime of an SD card is pretty dicey, it really depends. SD cards have a certain amount of read and write cycles they can do before they finally kill over. Using Apps2SD will be a bit more harder on the SD card, especially if you use a Swap partition too. I use both, and my SD card is still working even a year and a half later.
One benefit, though I don't know how much this means to you, more internal storage data gives you more storage for system applications, such as for Contacts, text messages, etc.
A word of warning though, as using these features like Swap and Apps2SD does put more work on the SD card, the chance of error and corruption on the card itself increases a bit too. So far, I have had two instances in the year and a half where my SD card simply just blanked out. The first time around I lost everything that was on it, music, pictures and all my applications and application data and my phone could no longer boot (this was an issue with older ROMs back in the day of Android 1.0 and when everyone though Cupcake was a myth, when running Apps2SD, the phones would need the SD card to boot, it is no longer a problem). Just a suggestion, backup what is on your SD card every once in a while. I don't mean to scare you with that, it is extremely rare for that to happen, I believe I was just unlucky.
With Apps2SD, I actually feel a lot more free on my phone. I can install tons of applications and not have to worry about running out of memory, I have over 100 applications installed, which the internal memory (because of the applications I have) can't even hold.
So to wrap it up, I apologize for the long winded explanations, I say go Apps2SD, it really is worth it. Most of the ROMs today support automatic Apps2SD, whenever you install an application it just automatically goes onto your Ext3 partition. (Yes, you will need to repartition your SD card to have an Ext3 partition as well as a Swap partition if you want, this can be done really easily with Amon's Recovery Image.) In some ROMs, you can just go to the settings/ Spare Parts section and check Apps2SD.
so basically app2sd has only to do with the internal memory...it will not help free the ram even with a swap drive, is this what your saying correct
it will help only with installed applications
Yes that is correct, Apps2SD is designed to keep internal storage memory free and open for other things like text messages, call logs, internet data (cache, cookies, etc) and cache data for other applications like Google Maps and the Android Market.
where are the text messages stored by default, in the internal memory or the sim card, cause my old phone could hold only 25 messages in the sim card, how does this work on here
Messages are stored in internal memory and no where else, they can be moved to the SIM card with other applications, though space is extremely limited there.
hitman3x said:
1) i have on average 36m of available memory, is this normal? i got task manager app and seem to be at my optimization limit..
Click to expand...
Click to collapse
This is a linux based system.. "free" memory is pretty much meaningless. Stop worrying about it. Task manager apps are a waste of time and actually cause a lot of problems in android.
hitman3x said:
2) im on stock 1.5 now, what is the fastest and most efficient firmware out now that reduces the bloat and optimizes the phone, and how do i put it on the phone
Click to expand...
Click to collapse
Why don't you root your phone and find that out for yourself? Everyone has their own favourite build so you won't get many meaningful answers here.
hitman3x said:
3) what else can you do with the usb cable
Click to expand...
Click to collapse
Err.. I don't know.. lace your shoes with it? That's an odd question.
hitman3x said:
3) what else can you do with the usb cable, is there a 3rd party android client for pc or something like that? anything interesting like that
thanks
Click to expand...
Click to collapse
Well once rooted, with most roms you can tether your pc to your phone for internet access (using the phone as a modem so to speak). useful if you are in dire need of internet access using a pc/laptop with no current available wired connection.
alright i figured most of this out i tried thedudes lite and dwang 1.17.1 build
the only problem i have is any build on donut (1.6) makes my camera not work the camera closes unexpectedly all the time (full wipe)
on cupcake its completely fine

Android scandisk/defragmenter for sdcard

Was wondering if there is a tool available to perform scan on our sdcard and also defragement it. Or maybe a command from the console to also perform this task just like on a window OS.
Sent from my FIH-FB0 using xda premium
wesleyel said:
Was wondering if there is a tool available to perform scan on our sdcard and also defragement it. Or maybe a command from the console to also perform this task just like on a window OS.
Sent from my FIH-FB0 using xda premium
Click to expand...
Click to collapse
From my knowledge of Linux this is taken care of by the system on boot. Defrag, scandisc would preferred at system or swap partion if used for a longer time. Depends on file system more than windows applieable in this case. Please correct me on this..
My dog sent this while a I took a leak...
Not sure about scandisk utilities, but defrag is only necessary for conventional hard drives that contain an actual spinning disk. The reason for this is that on a spinning drive, fragmented files are scattered across multiple physical locations on the disk. This is not a concern for solid state drives, including both built-in storage and SD cards. With solid-state memory, the physical location of data is irrelevant.
In fact, defragmenting solid-state memory is actually detrimental to the hardware. Each "cell" of the chip can only survive a few hundred of thousand delete/write cycles before it fails. This is typically not a concern as A) this is usually far more than would happen during the expected life of the device itself and B) low-level software performs "wear-leveling" ensuring that some cells don't get written to excessively while others remain unused and C) this low-level software is also able to detect bad cells and flag so they do not get used, in a way that is completely transparent to the end user. The reason defragmenting is bad for solid-state chips is that it involves many delete/write operations which slowly degrade the chip, but which ultimately serve no greater purpose.
Thanks for clearifying this.
My dog sent this while a I took a leak...
Zfwaeld said:
Not sure about scandisk utilities, but defrag is only necessary for conventional hard drives that contain an actual spinning disk. The reason for this is that on a spinning drive, fragmented files are scattered across multiple physical locations on the disk. This is not a concern for solid state drives, including both built-in storage and SD cards. With solid-state memory, the physical location of data is irrelevant.
In fact, defragmenting solid-state memory is actually detrimental to the hardware. Each "cell" of the chip can only survive a few hundred of thousand delete/write cycles before it fails. This is typically not a concern as A) this is usually far more than would happen during the expected life of the device itself and B) low-level software performs "wear-leveling" ensuring that some cells don't get written to excessively while others remain unused and C) this low-level software is also able to detect bad cells and flag so they do not get used, in a way that is completely transparent to the end user. The reason defragmenting is bad for solid-state chips is that it involves many delete/write operations which slowly degrade the chip, but which ultimately serve no greater purpose.
Click to expand...
Click to collapse
Wow I just got educated. Thanks a ton bro...
Sent from my FIH-FB0 using xda premium
wesleyel said:
Was wondering if there is a tool available to perform scan on our sdcard and also defragement it. Or maybe a command from the console to also perform this task just like on a window OS.
Sent from my FIH-FB0 using xda premium
Click to expand...
Click to collapse
There is no need to defragment as told already above. But you can Consolidate free space to make a large pool of free space and yes Consolidating free space increases "write" speed if memory is low because to writing to several small location takes more time than writing to a continuous memory block... use MyDefrag free software to Consolidate space.
But, when it is damage SD, dont knwo why... becasue i didnt touch the ****ing cell phone.. it is not a "scandisk" command from system or any app could make it? I cant find nothing.. must I take it out and do it under windows???
thanks.

Categories

Resources