开发者

JSON array deserialization is crashing the Dalvik VM

I have some code grabbing a JSON array from my server and initially storing it as a string. This all works fine until I try and deserialize it using google's gson fromJson method. LogCat spits out the error:

04-08 17:46:35.163: ERROR/dalvikvm(401): Can't shrink stack: curFrame is in reserved area (0x41049000 0x410491c4)

My code that causes the error is:

String[] results = gson.fromJson(returnString, String[].class);

Can anyone shed some light on what 开发者_StackOverflow中文版I am doing wrong?

Cheers, Sam


You may be running into the following open issue: http://code.google.com/p/android/issues/detail?id=6245.

The stack is supposed to expand briefly while the StackOverflowError is being handled, then shrink back down afterward. The problem is that an exception is being thrown during the SOE processing, and we're trying to shrink the stack down when that second exception finishes, instead of waiting until we're wrapping up the SOE itself.

There's also enough going on during the SOE recovery that an extra 512 bytes of stack isn't enough, and it'll encounter a double-SOE.

How large is the JSON that you are trying to de-serialize?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜