PC Review


Reply
Thread Tools Rate Thread

DEFRAGMENTATION OF STORAGE CARD

 
 
Thore Berntsen
Guest
Posts: n/a
 
      12th Jun 2005
I have had problems with the speed of my Pocket PC application on some
Pocket PC's. It does a lot of writing to files on the storage card. I
suspected that my speed problem could have something to do with
fragmentation of the storage card. So I formatted it on one of the Pocket
PC's that had trouble. Then my application performed as expected again.

Does anyone know if there is a defragmentation API available that I can buy
and use in my application.

Thore Berntsen
VBD, Norway


 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      12th Jun 2005
Flash media physically wears out, so storage cards have internal controllers
that handle fragmentation and wear levelling. In fact it's unlikely that
the controller can be bypassed to give you raw access to the physical media.
Flash is also inherently a slow media, so if you're expecting speed, you
probably need to rethink how you use it. You'll never get performance from
flash media.

-Chris


"Thore Berntsen" <someone@microsoft,com> wrote in message
news:(E-Mail Removed)...
>I have had problems with the speed of my Pocket PC application on some
>Pocket PC's. It does a lot of writing to files on the storage card. I
>suspected that my speed problem could have something to do with
>fragmentation of the storage card. So I formatted it on one of the Pocket
>PC's that had trouble. Then my application performed as expected again.
>
> Does anyone know if there is a defragmentation API available that I can
> buy and use in my application.
>
> Thore Berntsen
> VBD, Norway
>



 
Reply With Quote
 
Steve Maillet \(eMVP\)
Guest
Posts: n/a
 
      12th Jun 2005
"You'll never get performance from flash media."

That depends on what your requirements are. The OP stated the perf is
acceptable with a fresh format of the card so there ARE things that can be
done in this case. Besides fragmentation is a factor of the File system and
not the card. That being said fragmentation on a solid state media is mostly
irrelevant as there are no seek time delays. (Well, yes there, are but they
are constant time for all locations on the disk) Theoretically, you can
measure a difference if all the sectors of a file read can be read as a
contiguous chunk of physical sectors, however due to wear leveling that will
virtually never happen after the card is first used.

There is a significant and noticeable performance curve point that happens
once the solid state drive becomes 50% FULL. At this point the wear leveling
algorithm has to work harder to find a place to move sectors around to. The
more full it gets, the longer it takes.


--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com


 
Reply With Quote
 
Guest
Posts: n/a
 
      12th Jun 2005
I've done a fair amount of profiling of several controllers, software and
hardware, and have found that anything above about 25% full causes
significant performance degradation. This occurs whether you sequentially
add block-swized files to the media (meaning the controller by all righs
should have to do no load leveling, compaction or movement) or if you fill
the media with small files then delete random holes and refill. I don't
think the OP can do much about what he's seeing to guarantee any type of
performance. A larger CF card will behave better for longer, but that's
only because it's larger. Moving to a microdrive would probably be a
solution for speed, but cost and reliability suffer.

Again, we've got no idea wht he usage is, nor his accepatnce criteria, but
my opinion is that if he sees unacceptable behavior with Flash media, then
he's never going to surmount it staying with Flash media. Maybe a RAM
solution with a flash backup would work. Maybe a microdrive. At any rate,
there's no way to defrag the card.

-Chris


"Steve Maillet (eMVP)" <(E-Mail Removed)> wrote in message
news:uv%23$(E-Mail Removed)...
> "You'll never get performance from flash media."
>
> That depends on what your requirements are. The OP stated the perf is
> acceptable with a fresh format of the card so there ARE things that can be
> done in this case. Besides fragmentation is a factor of the File system
> and not the card. That being said fragmentation on a solid state media is
> mostly irrelevant as there are no seek time delays. (Well, yes there, are
> but they are constant time for all locations on the disk) Theoretically,
> you can measure a difference if all the sectors of a file read can be read
> as a contiguous chunk of physical sectors, however due to wear leveling
> that will virtually never happen after the card is first used.
>
> There is a significant and noticeable performance curve point that happens
> once the solid state drive becomes 50% FULL. At this point the wear
> leveling algorithm has to work harder to find a place to move sectors
> around to. The more full it gets, the longer it takes.
>
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>




 
Reply With Quote
 
Thore Berntsen
Guest
Posts: n/a
 
      12th Jun 2005
I'm a little confused here. What I did was, copy the files on the storage
card to my laptop, format the card from the laptop, and then I copied the
files back to the storage card and insert it into the Pocket PC again. My
idea was that this would take care of the defragmention I suspected on the
card. My application was much faster after I did this. My conclusion was
that I got rid of fragmentation, is this conclusion wrong? I must mention
that I haved used this Pocket PC very much for automated testing the last
month.

I just downloaded a tool from this link
http://www.softwinter.com/storagetools.html I haven't tested it yet, but
it's a defragmention tool.

"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
news:(E-Mail Removed)...
> I've done a fair amount of profiling of several controllers, software and
> hardware, and have found that anything above about 25% full causes
> significant performance degradation. This occurs whether you sequentially
> add block-swized files to the media (meaning the controller by all righs
> should have to do no load leveling, compaction or movement) or if you fill
> the media with small files then delete random holes and refill. I don't
> think the OP can do much about what he's seeing to guarantee any type of
> performance. A larger CF card will behave better for longer, but that's
> only because it's larger. Moving to a microdrive would probably be a
> solution for speed, but cost and reliability suffer.
>
> Again, we've got no idea wht he usage is, nor his accepatnce criteria, but
> my opinion is that if he sees unacceptable behavior with Flash media, then
> he's never going to surmount it staying with Flash media. Maybe a RAM
> solution with a flash backup would work. Maybe a microdrive. At any
> rate,
> there's no way to defrag the card.
>
> -Chris
>
>
> "Steve Maillet (eMVP)" <(E-Mail Removed)> wrote in message
> news:uv%23$(E-Mail Removed)...
>> "You'll never get performance from flash media."
>>
>> That depends on what your requirements are. The OP stated the perf is
>> acceptable with a fresh format of the card so there ARE things that can
>> be
>> done in this case. Besides fragmentation is a factor of the File system
>> and not the card. That being said fragmentation on a solid state media is
>> mostly irrelevant as there are no seek time delays. (Well, yes there, are
>> but they are constant time for all locations on the disk) Theoretically,
>> you can measure a difference if all the sectors of a file read can be
>> read
>> as a contiguous chunk of physical sectors, however due to wear leveling
>> that will virtually never happen after the card is first used.
>>
>> There is a significant and noticeable performance curve point that
>> happens
>> once the solid state drive becomes 50% FULL. At this point the wear
>> leveling algorithm has to work harder to find a place to move sectors
>> around to. The more full it gets, the longer it takes.
>>
>>
>> --
>> Steve Maillet
>> EmbeddedFusion
>> www.EmbeddedFusion.com
>> smaillet at EmbeddedFusion dot com
>>
>>

>
>
>



 
Reply With Quote
 
Steve Maillet \(eMVP\)
Guest
Posts: n/a
 
      13th Jun 2005
"At any rate, there's no way to defrag the card."
No that's not true. fragmentation has NOTHING to do with the card. It's a
file system level thing and you can defrag a flash card if you really want
to. It has a HUGE impact on a Microdrive over time. However. fragmentation
has virtually no impact on solid state media.


--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com


 
Reply With Quote
 
Steve Maillet \(eMVP\)
Guest
Posts: n/a
 
      13th Jun 2005
Microsoft provides defragmentation of FAT formatted systems in the OS.
Although I'm not sure if that ships as part of the Pocket PC OS Builds...

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com


 
Reply With Quote
 
Christian Schwarz
Guest
Posts: n/a
 
      13th Jun 2005
> Does anyone know if there is a defragmentation API available that I can
> buy and use in my application.


Maybe you want to take a look at the FatUtil library functions
(http://msdn.microsoft.com/library/en...yfunctions.asp).

Greetings, Christian


 
Reply With Quote
 
Thore Berntsen
Guest
Posts: n/a
 
      13th Jun 2005
I must mention that the Pocket PC's I have this problem on uses Compact
Flash Disks not SD cards. Can that make a difference?

Thore Berntsen
"Steve Maillet (eMVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "At any rate, there's no way to defrag the card."
> No that's not true. fragmentation has NOTHING to do with the card. It's a
> file system level thing and you can defrag a flash card if you really want
> to. It has a HUGE impact on a Microdrive over time. However. fragmentation
> has virtually no impact on solid state media.
>
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>



 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      13th Jun 2005
Ok, so maybe we have term mismatch here. I think of "defragmentation" as
taking pieces of files and putting them in physically sequential locations
on the media to allow the file system to access them in less number of
reads. On a device with heads this also reduces the need to reposition the
heads which is where the major performance gains comes from.

Now flash media typically has a controller, either in software or hardware,
that controls the physical location of data so it can provide wear leveling.
This is an attempt to equally use all parts of the media to prolong life.

So in order to "defrag" a flash media system, you would have to bypass the
wear-leveling piece in order to physically arrange your data. That's
typically not an option.

But as you said, with solid state media, you're not going to get much gain
even if you could because the slowness from fragemented media is probably
95% in the need to do multiple moves of the physical drive head and this
only occurs where there are moving parts (like a microdrive, which has no
load levelling and can be defragmented).

If I'm wrong I'm fine with that and I'd love to understand how flash media
could be defragmented.

And of course this all applied only to writes for flash media. Reads are
fast, so if the OP is seeing read problems it may be something altogether
different.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Steve Maillet (eMVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "At any rate, there's no way to defrag the card."
> No that's not true. fragmentation has NOTHING to do with the card. It's a
> file system level thing and you can defrag a flash card if you really want
> to. It has a HUGE impact on a Microdrive over time. However. fragmentation
> has virtually no impact on solid state media.
>
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I install GAC to storage card in CF 2.0 SP1 ? maps@amudanan.com Microsoft Dot NET Compact Framework 4 25th May 2006 09:09 PM
Storage-Card in Emulator? Kenny Rymes Microsoft Dot NET Compact Framework 2 8th Apr 2006 10:23 PM
Problems with SD-MMC storage card Thore Berntsen Microsoft Dot NET Compact Framework 0 14th Oct 2005 04:57 PM
about storage card icsi Windows XP Drivers 0 11th Aug 2004 09:10 AM
Storage Card Thore Berntsen Microsoft Dot NET Compact Framework 2 2nd Feb 2004 11:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.