Application freezes because of "unknown thread"

D

Dominik Gallus

Hey there,

have to hang out another problem for today which i can't figure out.

I'm about to develop an application with a lot of drawing operations by
using System.Drawing Namespace.
I also use Double Buffering techniques.

The problem is as following.
Application works fine most of the time. It includes a contact overview
with a scrolling mechanism all drawn by System.Drawing.
Sometimes the applications freezes and i can't hardly do anything.

About 20-40 seconds later it all works fine again.
Visual Studio Output shows a "The thread 0xa3055b3e has exited with code
0 (0x0)."

So there must be something running in the background (a failing method?
call?) that is blocking the application/drawing/rendering/whatever

Some Information about what is going on inside the app while it freezes:
- There are no external calls besides the use of System.Drawing
Namespace. So maybe it's caused by a System.Drawing-Method?
Also removed any calls to phone-properties etc.

- The Render-Method only renders the Items that are visible on the
screen (about 8-10). So there shouldn't be too much rendering going on.

- For modifying velocity properties there is a timer running at a value
of "10". I also modified it up to "10000" and it didn't change anything.
So i also don't think it is caused by the Timer.

Any suggestions?

Thanks in advance,
Dominik
 
G

Guest

If you're using a lot of drawing objects and not reusing where possible,
you're probably generating a lot of garbage and it's possible that the GC is
running (though 20 seconds would be insane). Otherwise we really don't have
much to go on. Run RPM against the app and see what it says is going on.
 
D

Dominik Gallus

Thanks for your answer,

well, yeah, i'm using a lot of objects, but still the same behaviour if
i limit the objects to draw.

Could there be any problem, because i'm doing updates on my
object-instances through a timer tick, so it runs on a different thread
and that is causing the problems?

After a lot of more optimization it's behaving like this.
The application runs fun for minutes, then it slows down till there is
no more response for some seconds, after that it speeds up again is
working like a charm.

One thing is, that the "Thread Exit" Message is not always showing up,
but most of the time.
 
G

Guest

What kind of Timer? A Forms timer is *not* on a different thread - a
Threading Timer is. If you're using a Threading Timer then I would expect a
full lockup under CF 1.0 and an Exception immediately in CF 2.0.

Again, run RPM and see what's happening rather than guessing.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
 
D

Dominik Gallus

Oh yeah, you are totally right. It is a Forms Timer Stupid me.

Well...uhmmm...shame on me...but can u tell me about RPM what it is? or
a helpful link?

Thanks in advance,
Dominik
 
D

Dominik Gallus

Oh ok found it.

Found the explanation by Google Groups, where you (ctacke) have
explained it to some other guy in Feb 2007 ;)

Thanks anyway.
 
D

Dominik Gallus

Ok, i did check the Application with the RPM

Which was a great advice i want to thank you for.

So, what is happenning that, that the application starts slowing
down/freezing after the GarbageCollector has run for the first time.

Well i've never run THAT DEEP into that stuff, so i can only guess what
that means.

So, is it because of too many objects? (1473 Objects finalized after
first collection). Which would lead to the fact, that there is something
really stupid going on with my class architecture.
I dunno if the 1473 is realistic.
Do my objects get reopened on every OnPaint-cycle?

I really don't know.

Is there any other reason why my application could freeze because of
GarbageCollection?

Thankful for any advice,
Dominik
 

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