I've been digging a little deeper into this frustrating problem.
I have read several threads in this forum regarding the "conflicting stack sizes" error in the Nokia 7210 emulator. Some of you seem to have found the reason for this annoying error, however none of the posted workarounds worked for me when I suddenly faced the same error continuously.
I'm developing a multiplayer game platform that utilizes http polling - so first thing I checked up on, was to make sure that all streams were being closed properly after each request and that gc was called. Everything was fine there...
However the problem occured already during processing of the first http response, so I thought this wasn't necessarily a memory leak issue.
It was even more freaky that the error didn't occur at one particular line; if I removed a line or a method call, the next line or maybe a line in the next method would cause the error instead. This was not periodical. It happened each time I ran the emulator and at the exact same line - until I modified the code.
It seemed that I was able to get rid of the error if I reduced the number of method calls that the executing thread ran through. That was the thread which performed the http request, analyzed the http response content and delegated the extracted network messages to observers. However the chain of method calls for this thread was not larger than previous when everything worked alright, and it was not a solution for me to reduce the chain of method calls as that would ruin my object collaboration structure.
The problem had occured several times during development of the game platform, but each time (until now) only when I by accident introduced a bug which caused an infinite loop, or something similar.
So what suddenly hit me, was that the difference from when everything worked allright till now, was that now I performed heavy UI initialization during startup while the network thread was running and performing http requests.
So I thought I'd try to finish all UI initialization (during MIDLet.startApp() method) BEFORE I started the network thread. This means that the event thread now had a chance to finish its initialization before my network thread ever started.
And vola!! The dark cloud finally disappeared.. No more "conflicting stack sizes".
I guess one can conclude that (at least in this case) "conflicting stack sizes" means; the stack being overrun when the event mechanism thread and some other thread simultaniously are performing a great chain of method calls - thus putting a great amount of information on the stack?
I guess this can be considered a stack handling bug in the Emulator?
Would be nice to hear the exact meaning from a Nokia Developer.
This was my five cents on the "conflicting stack sizes" problem.
I thought I whould share it with you.
End of story.