×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Copenhagen, Denmark
    Posts
    18

    Conflicting stack sizes - again!

    Hi guys!

    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.
    Last edited by schm1; 2003-08-12 at 23:24.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    Stack size

    Is this is only a problem on the emulator or have you seen it on phones also?

    I see you are locationed in Copenhagen. So are we. From your answer it seems we have common interests. Could be interesting to talk.
    If you want - give me an email: xx@watagame.com

    best regards
    Henrik

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Copenhagen, Denmark
    Posts
    18
    Hello Henrik,

    The "conflicting stack sizes" problem does not occur on the handset. At least not in this situation.

    However I must deal with it in the emulator, because its not very handy to transfer the Midlet to the handset during each test run - not even with a cable.

    Thanks for your interest, I'll contact you through email.

    /Jeppe

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    Great!

    Sounds great. Looking forward to hearing from you.
    >H

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Copenhagen, Denmark
    Posts
    18
    Hello Henrik,

    I tried to write you an email, but your server refused to deliver it to the adress you wrote above.

    should I replace XX with your nickname?

    UPDATE:
    I tried that, no luck what so ever...
    Last edited by schm1; 2003-08-30 at 22:29.

  6. #6
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    email

    sorry. I closed the xx@watagame.com account. I only use it temporarily, in situations - like this fora, where I do not like to reveal my normal email. I have now opened it again and am looking forward to your mail.

    Best regards
    hriis

  7. #7
    Registered User
    Join Date
    Mar 2003
    Location
    Copenhagen, Denmark
    Posts
    18
    I understand - hate those spammers too :-)

    You've got mail..

  8. #8
    Registered User
    Join Date
    Jan 2004
    Location
    Poland
    Posts
    49

    Re: Conflicting stack sizes - again!

    Little late to throw my stone into discussion, but I found "conflicting..." appear when any initialization (start app) or ui threads are past for long (this is my case). Shmoove's answer seems to explain it better - extensive heap usage...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×