Slow UI Creation

L

LitriNet

Hi everyone, i don't have experience with windows mobile but i
development an application using windows mobile 6 , sql server compact
and i have a htc hd2 for testing the application.

My problem is that the first time the application start,it's running
with the normal speed and work rightly but if i stop the application
and start other time i don't know but starts running slowly, i can
see how the UI are being created slowly, and when i click on a button
there are a delay. I need to restart the pda to get a normal running
other time. I looking for lossing memory or something else but i don't
find the problem are..

Can someone help? or suggest me where should I looking for?
 
M

MarkusSchaber

Hi, LitriNet,

Hi everyone, i don't have experience with windows mobile but i
development an application using windows mobile 6 , sql server compact
and i have a htc hd2 for testing the application.

My problem is that the first time the application start,it's running
with the normal speed and work rightly but if i stop the application
and start other time  i don't know but starts running slowly, i can
see how the UI are being created slowly, and when i click on a button
there are a delay. I need to restart the pda to get a normal running
other time. I looking for lossing memory or something else but i don't
find the problem are..

Can someone help? or suggest me where should I looking for?

Maybe when you stop the application, it does not free all ressources,
or some threads keep on running and spinning for the CPU?

Markus
 
L

LitriNet

Hi, LitriNet,





Maybe when you stop the application, it does not free all ressources,
or some threads keep on running and spinning for the CPU?

Markus

Hi Markus,

In my Main method i have a finally where I kill the proccess, i don't
know if this is the better option

finally
{
Application.Exit();

uint id = uint.MinValue;
List<ProcEntry> list_ = new List<ProcEntry>();
if (PPVBeach.ProcessEnumerator.Enumerate(ref list_))
{
for (int i = 0; i < list_.Count; i++)
{
if (list_.ExeName.ToUpper().Contains("BEACH"))
{
id = list_.ID; ;
break;
}
}

if (id != uint.MinValue)
{
ProcessEnumerator.KillProcess(id);
}
}
}

Thanks
 
B

Brian

Hi, LitriNet,
Maybe when you stop the application, it does not free all ressources,
or some threads keep on running and spinning for the CPU?

Hi Markus,

In my Main method i have a finally where I kill the proccess, i don't
know if this is the better option

finally
{
    Application.Exit();

    uint id = uint.MinValue;
    List<ProcEntry> list_ = new List<ProcEntry>();
    if (PPVBeach.ProcessEnumerator.Enumerate(ref list_))
    {
        for (int i = 0; i < list_.Count; i++)
        {
            if (list_.ExeName.ToUpper().Contains("BEACH"))
            {
                id = list_.ID; ;
                break;
            }
        }

        if (id != uint.MinValue)
        {
            ProcessEnumerator.KillProcess(id);
        }
    }

}

Thanks


Are you certain that the code after Application.Exit is executing?
Either way, I've never seen an app close down it's threads this way.
You should use some flags to manage the threads. So, inside your
child threads all the work is done inside a loop, like so:

bool killthread = false;

while(!killthread)
{
//do thread work here
thread.sleep(100)

}

//dispose of any resources

Then, when it is time to close out the application you can set
killthread = true for all of the child processes in your main thread.
 

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

Top