Memory error on pda

  • Thread starter Thread starter Jorge
  • Start date Start date
J

Jorge

Hello. I use the following instructions to create and to show the "forms":
Form_Exportar Ficha = new Form_Exportar(); // Project has form_exportar

Ficha.ShowDialog();

Ficha.Dispose();

Nevertheless, if I do a follow-up of the memory occupation on the PDA, I see
it's growing and It doesn't liberate itself . If I open and close several
times this form, the memory is dealing until there comes a moment in which
the application gives a memory error (full).
What about Dispose function? What's happened? Does not dispose function
work?
What can I do in order to free forms?
Thank you
 
Hi,


Are you holding a reference to the form?

AFAIK there is no need to call Form.Dispose manually ,
Are you calling Form.Close ?
 
Hi. I try to use Form.Close but It doesn't work. It fills PDA memory like
using Form.Dispose.
Also, I try Form.Close and Form.Dispose together, but It doesn't work too.

Our example project has the next structure:

Main Form with 4 buttons.
When user push a button it creates a open a new modal form. I use the next
code:

private void button2_Click(object sender, System.EventArgs e)

{

Cursor.Current = Cursors.WaitCursor;

Form_Articulos Ficha = new Form_Articulos(); // Creating the form

Cursor.Current = Cursors.Default;

Ficha.ShowDialog(); // Show form

Ficha.Close(); // Close the form

Ficha.Dispose(); // Free

}

I try with close, with dispose, without close, all combinations.

If we see pda's memory, we can see Main Form running and when we open a form
pushing one button, this form appears on pda memory. When we close the form,
it disappears, but it doesn't liberate memory occupation. When we close main
form and exit program, then memory is liberated.

What can we do?

Thanks.
 
Hi,


Ficha.ShowDialog(); // Show form

Ficha.Close(); // Close the form

Ficha.Dispose(); // Free

No need to call neither Close nor Dispose, the form is closed already !!!
You have to call the Close() method inside the form ( or not call it at all)
 

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

Back
Top