none
Slow Directory.Delete on NAND Flash RRS feed

  • Question

  • Hello,

    We're currently busy developing a portable device that performs certain measurements and stores the raw data of these measurements on the device (on NAND flash memory). This measurement data uses a circular buffer, so after a certain amount of time the oldest data is removed.

    When this raw data is removed, typically a directory containing 10 subdirectories is deleted (total amount of data: roughly 8 Mb). This doesn't sound like a gigantic amount of data to remove, but we're currently seeing that removal (using the Directory.Delete(x, recursive=true) call takes about 11 seconds for such a structure.

    Now I know that NAND isn't the fastest when it comes to data modification, but 11 seconds to delete a directory doesn't sound like 'normal operation' to me. Has anybody experienced this kind of issue using NAND flash in conjunction with WindowsCE6 and Compact Framework 3.5 ?

     

    Thanks and regards,

     

    ElGwappo

     

     

    • Moved by Jesse Jiang Wednesday, September 7, 2011 6:16 AM (From:.NET Compact Framework)
    Monday, September 5, 2011 7:35 AM

All replies

  • Sounds like the implementation of your NAND flash driver is probably causing the delay.    My guess is that it is erasing the flash media as a foreground task, that is your code must wait for the driver to erase the flash.   The updside is that flash is ready to go when you need to write to it.

    Some drivers speed up the process by erasing as a background task, that is in the foreground the files/folders are marked as erased, but the flash isn't erased, then a low priority thread runs in the background and erases the flash when it can.   The downside is that if flash isn't ready to go when you need to write to it, your writes can become slower.  So this works best if you have a lot more flash than you actually need to store your files.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, September 6, 2011 3:59 PM
    Moderator
  • Hi ElGwappo,

     

    I think your issue should be raised in the Windows Embedded Compact Platform Development. I believe they will know more information of this issue than us, and I will move this one to that forum.

     

    Thanks for your understanding,

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, September 7, 2011 6:15 AM
  • Hi Jesse,

     

    No problem, thanks for moving the post to the correct forum...

     

    Regards,

    ElGwappo

    Wednesday, September 7, 2011 11:22 AM