Memory doesn't clean

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,

I'm running an application (on a windows ce device) that I wrote that uses
alot of memory (alot of DB access,arraylist,ect).
I'm checking the memory load every 1 minute, and I see that the memory grows
and grows, but when the objects that used that memory are freed the memory
doesn't get free right away. The memory load just gets higher and higher.
Trying to manual run the GC.Collect() doesn't seems to have any effect.

When the memory load reaches 96%-99% it sometime drops to 90%. but from time
to time the device get stuck (totally stuck), and you have to remove the
battery in order to restore it for work.

Now, I know that the GC works on its own allgoritm, but this doesn't make
sense, the application doesn't really uses 96% or event 90% of the memory
(not counting that the application started with memory load of 50%)


Any help?

Tomer.
 
Are you allocating any native memory e.g. when P/Invoking API functions? Are
you calling Dispose() on all objects which expose the method?

Peter
 
Yes I am using P/Invoke, and I'm allocating any native memory. On most
object I do call dispose (the ones that have the dispose method, an object
that don't have dispose method, Iset it to null).

Tomer.
 
Back
Top