Moving files from SD to main memory causes not-enought-memory

Moving files from SD to main memory causes not-enought-memory

Post by KhAo » Thu, 27 Jul 2006 16:36:10


I have rare problem (probably on MDA II, WM5, but not confirmed):
when moving file (about 19MB) using C routine MoveFile from SD card to
main memory function return not enought memory problem. I'm sure, there
is enought free storage... so, is it confirmed / known problem?
 
 
 

Moving files from SD to main memory causes not-enought-memory

Post by Yaroslav G » Thu, 27 Jul 2006 17:05:32

It is important to know for sure if it is WM 5 device or not. On older
devices the main memory was based on the object store. In the object store
because of fragmentation in some cases you could not create one big file
that takes the rest of the free space. Usually in such a sitation short
sleep interval after a failure of WriteFile would help.

--
Yaroslav Goncharov
Spb Software House, http://www.yqcomputer.com/
Pocket PC Developer Network, http://www.yqcomputer.com/

 
 
 

Moving files from SD to main memory causes not-enought-memory

Post by KhAo » Thu, 27 Jul 2006 21:05:44

at this moment all occurences on WM 5.

Classic moving using file explorer works fine.
 
 
 

Moving files from SD to main memory causes not-enought-memory

Post by » Thu, 27 Jul 2006 23:42:54

MoveFile uses a buffer that can cause OOM on large files. Try using a
CreateFile/WriteFile loop to copy the file in blocks instead of the MoveFile
API.

-Chris
 
 
 

Moving files from SD to main memory causes not-enought-memory

Post by r_z_are » Fri, 28 Jul 2006 07:10:13

On Wed, 26 Jul 2006 10:42:54 -0400, "<ctacke/>"



Until WM 6 comes along, each process has only 32 MBytes. So 19 MBytes
can feel rather large.





-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com