10-10-2008 02:47 AM
I have application which play audio. While playing/switching between different audio it gives "Uncaught exception: net.rim.vm.Satck overflowError" .
What is the cause of this exception?
10-10-2008 08:24 AM
So, seriously, more info would be required in order for you to get a good answer to your problem - otherwise, you might see someone responding with "Well, your code must be overflowing the BlackBerry stack. Q.E.D."
Lacking any other data to scientifically wild-azz guess upon, my suggestion (not solution) is for you to take a look at the BlackBerry device Event Log the next time that particular exception gets thrown. The Event Log is available on the device (alt-L-G-L-G [lowercase letters work]) or you can retrieve it via USB cable using the javaloader.exe application found in the JDE's bin directory (javaloader -u eventlog > eventlogdatafilepath). I prefer the latter because it's easier to read and to search through.
In the log, exceptions are noted and come with limited traceback - you can see the class names and the methods they were executing, when the exception occurred, from the exception-generating object back up through the application main class. The last call in that chain of methods that came from one of your application classes is what's kicking off the exception.
Stack Overflows: these are most often caused by recursive operations - one of your methods calls another of your methods which eventually calls the original method, and the whole thing starts again (a call-chain loop).
10-10-2008 09:04 AM
From what I can tell, this is a RIM internals class and presumably is thrown from their code. It may help if you posted
some code and usage patterns. Sometimes I've found system resource messages don't always reflect the
specific problem ( out or memory thrown due to some graphics resource depletion for example) but you'd obviously
suspect recursion. I want to suggest some kind of buffer size problem but I'm not sure how this would generate
a literal stack overflow in java ( I haven't had enough coffee yet either as I;m confusing c++ and java...)
as the arrays get new'ed into heap and int buffer[bigsize] IIRC stores the buffer on the heap even if the ptrs
are on the stack.