iOS7 UIWebView Memory leak

后端 未结 2 716
灰色年华
灰色年华 2021-02-08 20:31

We have an comprehensive iOS app with Hybrid mode - a UIWebView hold the major part of the web application in JS. It works fine on iOS6, but recently we found serious out of mem

2条回答
  •  不思量自难忘°
    2021-02-08 21:18

    I don't have enough reputation to upvote or comment. So I think an "answer" is the only way that I can contribute.

    I agree with Ming Zhu's contribution. I found that if you have 5 digit keys (9999 < key <= 99999) the memory usage on iOS 7 explodes.

    Below is the example code that I came to when trying to reproduce what was crashing my app.

    tempobj = {};
    
    for(var i=1; i<2000; i++){
        var temp = {};
        tempobj[i] = temp;
        temp[98304] = "hello world";
    }
    

    I did also submit a bug to apple before finding this stackoverflow, but looks like that is a good thing anyways.

提交回复
热议问题