Flash Memory Fragmentation – Myths and Facts
Flash Memory Fragmentation and Performance A quick Google search shows many "expert" suggestions that defragmentation of solid state drives should give no difference in performance while increasing the wear of flash cards and even possibly killing them.
Myth: Flash cards unlike hard drives do not have movable parts so defragmentation is useless.
On theory, since a flash drive does not have moving parts, its access time is independent on where the data is stored, which is why supposedly flash drives don't need defragmenting.
The fact is that flash memory is physically organized in blocks (or pages) of data, usually 128K or 256K large. Things get even worse from the fact that in order to change even one single byte, the entire page has to be first erased and then re-written with its contents again. In our example the time needed to change one byte of information is calculated the following way:
T = R + E + W
T is the total time, R is the time needed to read the entire flash page containing the byte we wish to change, E is the time required to erase the page and W is the time it takes for the data to be written back to the empty page. Not only we had to read 128KB in order to change a single byte but we also had to erase the entire block (which is very slow) and then write 128KB over again.
To complicate matters even further, it must be noted that there are additional layers between the flash card controller and the file system that cache pages being read and written to. The cache serves for improving performance. It is a simple trade-off between read/write performance and some RAM being used to cache the pages. It is most effective to read or write entire flash pages performance wise. When the operating system instructs the controller to read a particular sector on the card the cache normally retrieves the entire block and stores it internally. What this means is that information that is stored in a contiguous matter is more likely to be found in the cache than non-contiguous information.
Suppose we have a file that is 263892 bytes large and is fragmented. On a FAT32 file system using 1K cluster the file will occupy 260 clusters. In the worst case scenario the clusters will be dispersed across 260 different flash pages. If the file is contiguous all 260 clusters will fit inside 3 flash pages. Caching of the fragmented file will be impossible as it won't fit in the cache (260 pages will require 33MB of RAM to cache) while the defragmented file will fit in just 384K.
And finally the FAT file system stores folders the same way files are being stored - in cluster chains. A large folder that is fragmented and is not cached represents a huge performance penalty for standard file operations like listing the files in that folder, renaming or even deleting a file.
Conclusion: Fragmentation has a serious impact on flash card performance especially during write operations and when the file system is heavily fragmented across many different flash pages.
Myth: Defragmentation shortens flash memory life span.
The truth is that flash memory has a limited number of write cycles. There are two types of flash chips used - NOR and NAND. Flash cards using NOR chips have a life span of approximately 300,000 write cycles while the ones utilizing NAND chips can stand up about 1,000,000 write cycles. NAND had historically less possible write cycles, but is catching up lately as the technology is improving. All fast CF cards are based on NAND flash (NOR flash is slower but has other advantages as processors can boot from it directly).
Just because a flash chip has a given write cycle rating, it doesn't mean that the chip will self-destruct as soon as that threshold is reached. It means that a flash chip with 1 million erase/write endurance threshold limit will have only 0.02 percent of the sample population turn into a bad block when the write threshold is reached for that block.
The flash card controller is tracking how often it wrote to a flash sector and is trying to level the wear of the sectors. This is called wear leveling. The storage card controller monitors how many times each disk block has been written. When a given block has been written above a certain percentage threshold, the solid state flash drive will (in the background, avoiding performance decreases) swap the data in that block with the data in a block that has exhibited a "read-only-like" characteristic.
Simple math shows that even if you write to ALL sectors of a flash card about 10 times a day (that is 20 GB of written data for an average 2GB flash card daily!) it will take about
82 years before 0.02% of the card blocks will turn into bad blocks.
Since defragmentation involves moving non-contiguous clusters belonging to a file chain to a contiguous cluster space the process indeed does wear the storage card. However modern flash cards have a great tolerance and will last for many years of heavy writing before sectors start becoming “bad”. Built-in wear leveling will further minimize card wear. Also once a file chain becomes contiguous (defragmented) it won’t be moved again during the next defragmentation.
Conclusion: Defragmentation indeed increases the number of flash media write-cycles. With modern flash cards life cycle and wear leveling this does not represent a potential problem as it takes decades for the sectors to start becoming bad.
Myth: Backing up the data of a flash card, formatting and then restoring it again will produce a file system free of fragmentation.
There are many opinions that instead of using defragmentation software one can defragment a storage card by performing a full backup of its contents, performing a fresh format and then restoring the files from the backup on the card again. The idea is that the operating system will lay the files in a contiguous way across the card and will therefore produce a free of fragmentation file system.
* Folders will become heavily fragmented. While the files are likely to be contiguous the same does not apply for folders. The reason is that folders are initially created small (usually one cluster only) and later on as new files are being added the OS extends the folders by adding new clusters to their chains. During the restore process folders will be initially created small and then as the files from the backup are restored inside the folders they will become fragmented as they grow. A folder that is one cluster long on a FAT32 file system using 1K cluster will be able to store about 5 to 6 files before it runs out of free directory entry space (one directory entry is 32 bytes and a long file name occupies usually more than 5 directory entries so one cluster can hold about 5-6 long file names).
* The entire process is very slow. It will take hours to copy back and forth a large flash card filled with multimedia.
* There are some specific optimizations carried out by defragmentation software that the backup/restore solution will not solve like flash block alignment or sorting of directory entries.
* All chances of data recovery are lost. If there were any deleted files that could be restored or file system errors that could be fixed they won't be recoverable at all after the backup/restore solution.
Conclusion: Using the backup/restore approach will not achieve the same results as using a well designed file system defragmenter.
Data reliability on fragmented vs. non-fragmented file systems
Should you ever need to recover lost data or deleted files from a storage card you should be aware that the more contiguous data on the card was the higher the chances of recovering that data is.
Data recovery software works by analyzing the existing data on storage devices and tries to reconstruct deleted or otherwise damaged files. When a file is deleted all information about the clusters it contained is lost. Undelete software will probably be able to locate the beginning of the file but without knowing the exact clusters it won't succeed in recovering the data if the clusters were not contiguous. Same goes for unformat/zero-assumption recovery software that attempts to rescue data from storage media with a damaged file system. Disk checking software like ScanDisk will also perform better and more reliably if the file system is not fragmented. That is the reason all FAT data recovery applications heavily rely on the file system being contiguous.
Conclusion: Keeping a file system free of fragmentation significantly increases the chances of data recovery.
************************************************** ******
2007 Essential Knowledge part 1 (Rechargeable Batteries) by markyap
In these times, it’s not an excuse not knowing…and knowing the wrong things are just as sinful. I will attempt to clear up some of the myths and wrong ideas about today’s everyday technology.
Today, the two most common rechargeable batteries we use with our digital devices are NiMH and Lithium-ion Type.
Nickel Metal Hydride (NiMH) batteries are much like the older NiCD batteries but with much improvement. More power capacity/density with less memory effect allows users to charge the battery with less maintenance. However, it is recommended that NiMH batteries be “reconditioned” or “maintained” by deep cycle charging (fully draining and fully charging couple of times) at least once every 1 to 3 months but not everyday as it will shorted the life of the battery.
BOTTOMLINE: NiMH Battery = Charge Anytime + deep cycle once in a while.
Lithium based rechargeable batteries like Lithium-ion (Li-ion) & Lithium Polymer (Li-poly) DO NOT have the so called “memory effect”.
It doesn’t need to be discharged before you start charging it.
They SHOULD NEVER be drained completely empty (0%). KEEP IT CHARGED!
keeping it charged up actually extends the battery life.
I always advice my clients to turn off their phones/laptops/etc. if they are in a low batt. situation rather than waiting for the device to completely turn off by itself as this could damage the device and/or the battery.
You can not and should not refresh or recondition lithium based batteries by the old NiCad solution of deep cycle charging.
Once its dead from excessive power drain, it will never carry charge again.
These new batteries will DIE if their voltage go below 3.0volts to 2.7volts!!
Heat shortens battery life. Cold lowers battery efficiency. Ideal working temp is room temperature. Excessive heat, improper charging and handling may cause it to explode!
Best way to store Li-ion batteries for long periods of time is to chill it to 0 °C with 40% to 50% charge (not fully charged!).
Wrap it in newspaper, then plastic seal it, store in your freezer (im sure you don’t have freezers that go lower than -20°C…-40 °C will kill the battery…ideal storage temp is 0 °C). Storing Li-ion batteries with almost empty charge for long period of time will kill the battery.
NOTE: buying extra battery for your device without proper storage will render battery unusable when you decide to use it.
BOTTOMLINE: Li-ion Battery = Charge Anytime + Never Fully Discharge
************************************************** ***************
2007 Essential Knowledge part 2 (Cellphones) by markyap
In these times, it’s not an excuse not knowing…and knowing the wrong things are just as sinful. I will attempt to clear up some of the myths and wrong ideas about today’s everyday technology.
Reserved Battery in cellphones is a MYTH!
Some phones have backup internal batteries to keep its internal clock and memory from wiping out when main battery is removed or completely dead. This is not “hidden battery power” that can be activated via secret code nor will it provide any power to keep the phone running.
Extending car remote range over great distances thru a cellphone call is a MYTH!
so called “Referb” or “Recon” are used original units reconditioned to look new may not be the case
99% of so called referb or recon here today are not made by the original manufacturer.
They are actually imitations of the original. They are made by underground or other factories and they are only made to look like the original. Yes they are actually brand new low quality imitations.
Cellphone Radiation scare...
at the levels cellphones today emit, they are deemed SAFE!
A device's SAR (measured in Watts per Kilogram, W/kg) is a reliable measure of its ability to cause cell damage and is a way of measuring the quantity of radiofrequency (RF) energy that is absorbed by the body. US has put a limit on SAR rating of devices to 1.6 w/kg to be deemed safe. Europe has raised the limit to 2.0 w/kg. In any case, the lower the SAR the better for our body.
Take nokia n90 and moto v3x for example, they have SAR rating of just 0.22 and 0.13 respectivly that’s pretty safe now wouldn’t you say
Checkout other phones SAR rating via the links below.
http://sar.nokia.com/
http://rfhealth-sar.motorola.com/sar/sar.html
Wired Handsfree Kit can reduce radiation up to 90% but in some situations it can actually increase by up to 3.5% (still in the safe limits
Bluetooth headset reduce emissions to 0.001 SAR rating
I guess this is the safest next to never using a cellphone for calls again.
Following studies of long time exposure have been published:
• A Swedish study (2005) that draws the conclusion that "the data do not support the hypothesis that mobile phone use is related to an increased risk of glioma or meningioma."
• A British study (2005) that draws the conclusion that "The study suggests that there is no substantial risk of acoustic neuroma in the first decade after starting mobile phone use. However, an increase in risk after longer term use or after a longer lag period could not be ruled out."
• A German study (2006) that draws the conclusion that " In conclusion, no overall increased risk of glioma or meningioma was observed among these cellular phone users; however, for long-term cellular phone users, results need to be confirmed before firm conclusions can be drawn."
• A joint study that draws the conclusion that "Although our results overall do not indicate an increased risk of glioma in relation to mobile phone use, the possible risk in the most heavily exposed part of the brain with long-term use needs to be explored further before firm conclusions can be drawn."
First Aid for your cellphones
More than 90% of WET PHONES can be saved if you follow this 1st aid tip. REMOVE the battery at once and have it serviced on the same day. The longer you wait to have it serviced, the less chance to revive it.
Do not attempt to turn on water damaged units before its serviced.
Instead, attempt to remove as much excess water as possible then take it to your trusted repair center for servicing (I don’t recommend authorized service centers in this case).
It should be properly cleaned with special chemicals to remove residue and prevent further corrosion and possible short-circuiting when the device is powered on.
If you have extensive knowledge with these devices and have the proper opening tools…(use at your own risk) you might consider using lacquer thinner in cleaning the phones board. I do not recommend alcohol. Simply drying (eg. hand blower, hair dryer, tv/monitor/laptop warm exhaust, etc) them is not enough!
Maintenance/Tips for your modern cellphones
Keep it charged! Do not drain your Li-ion batteries!!
Should you be low on battery. Don’t force it. Turn off the phone rather than risk it shutting off by itself and damaging the phone, its memory/data, or the battery.
Reboot your phone once a day. Turn the phone off and back on again before or after charging is a good habit.
When using replacement batteries or chargers, please do not overcharge. Monitor your charging times. Limit it to a few hours. Best to use original batteries and chargers.
For Flip/Clamshell and Slide type phones, minimize opening and closing of the unit. DO NOT PLAY WITH IT. Flex may easily be damaged.
Avoid radical change in temperatures. (leaving phone infront of the aircon and then leaving it in the car under the heat of the sun)
Keep internal phone memory as clean as possible. Save all photos, videos, music on the memory card.
Use data cable instead of irda or bluetooth to transfer large files like MP3 from computer to phone. Or use a memory card reader and transfer files directly on to the memory card.
The latter is the safest!
Minimize loading too many applications on to the phone. Only load those you use or will need.
In my experience, S.E. are more prone to dead sets than any other brands especially during the process of transferring files to the phone. Minimize this process or use at your own risk (or use memory card reader and load them to the card directly).
Best to purchase unit with FULL LOCAL UNIT WARRANTY, not just shop or service warranty.
REMEMBER to backup your phone data regularly!!