OutOfMemoryException: Webservice, DataSet and file transport

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

For transportation of a file, approx 850kB, I use a webservice which return
a dataset with one DataTable and a row. That row holds the file. After a
while I get an OutOfMemoryException on my Pocket PC device. The memory usage
increments exponential from 20MB -> 24MB, and my file is not that big.

Is this a known problem with the Compact Framework 1.0 SP2, on a Windows CE
4.2 device? Or by a certain memory allocation for the dataset?
Please any information is welcome.

Regards,
Tom
 
Pieter,

Do you mean that the SqlCeCommand objects needs to be disposed manually (by
calling .Dispose on code)? Are you sure the GC collector doesn't do it
automatically when getting rid of non-referenced objects?
 
Carlos,

Well, I had to insert around 5000 records in SQL Server CE, but after some
hundred records it failed because the device didn't have enough memory left.
By manually disposing the SqlCeCommand object each time, my problem was
solved. Maybe the GC comes in too late.

Pieter
 
Maybe you can try to transfer plain xml instead of transferring a dataset,
store it on the Pocket PC and parse it with an XmlReader. I don't know if
this will fit your needs, but it's worth trying.

Pieter
 
Back
Top