Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

I have an application on a mobile device with WM 6.1. I am running out of RAM.

My app only has one form open at a time, so what I am trying to do is make it so that when the user clicks the submit button at the end of a form that form is closed and completely removed out of the devices RAM. Does anyone know the code to do this.

Please let me know.

Thanks.
Kate
Posted

There is no "removing it from RAM". Once the form has been closed and references to it released, the Garbage Collector will do its job and release the memory it's using back to the managed heap. You don't need to do anything.

A common problem with using Form.ShowDialog is that people sometimes forget they have to call Dispose on the form object.

You do not need to do this if the form is shown with Form.Show.
 
Share this answer
 
Ok. So my device keeps closing my program randomly and after testing it showed that the RAM was close to full whenever the device closed the program. So basically there is nothing that I can do to free up that RAM?

Thanks.
Kate
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900