memory problems

T

tony

Hi,

Im using net cf 2 with sp2.

I'm working with Remote Performance Monitor .

For the simplicity, I want to know how and if I can do this :

I have 4 forms in my app :

frmMain
frm1
frm2
frm3.

When My app is starting with frmMain only, the memory used size is X .

then, im creating frm1, using it, and destroy it. (also dispose each control
in the end).
then, im creating frm2, using it, and destroy it. (also dispose each control
in the end).
then, im creating frm3, using it, and destroy it. (also dispose each control
in the end).

the last 3 stages im doing 10 times.

I notice with the Remote Performance Monitor :

1. there is no memory leaks if create and destory the frm1,frm2,frm3 10
times. (and that's OK)
2. even after destroy frm1,frm2,frm3 , the memory use will always be bigger
then it was when the application started with frmMain only (size X).

about section 2 :
There is no memory leaks , but How can i free ALL the memory that used when
created by frm1, frm2, frm3 ?


The problem are statring when i want to create frm4(four) but i get OUT OF
MEMORY execption if i used frm1,frm2,frm3 and destroy them.


Thanks.
 
L

Lcubed

Hi Tony,

You can do it, I have more than 4 forms in my app using .NETCF 2 sp2.
But from your post, it's hard to tell what you are doing wrong.

What do you mean by "destroy"? If you just call the .Dispose for the
form you don't need anymore then sooner or later the GC will come
around and clean it up.

How much memory is on your device? Maybe there is only enough to keep
one form in memory at a time?

Try your app with 4 nearly empty forms and see how well that works.

Also, a good posting article to read is: http://guruce.com/blogpost/howtoaskquestionsonnewsgroups
There's a good list of information that should be in the post that
will help others to answer your question.

L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

form flow 1
Why an Insert does not Occur 2
Change data and form crashes Access 3
New record in subform 3
MDI Child Wrong Event Firing 2
Destroying objects 2
memory leak with forms 1
Database access speed 2

Top