XMLPullParser上带有nextText的OutOfMemoryError

时间:2018-09-16 17:42:33

标签: android xmlpullparser

我正在尝试使用KXmlParser以XML格式获取较大的序列化文件(base64),但是使用 nextText()在Android上该应用程序崩溃了。我看到该库实现了{{3}},是否可以更改实现XMLPullParser的类,或者换一种方式获取流中的数据?

java.lang.OutOfMemoryError: Failed to allocate a 135970824 byte allocation with 6291456 free bytes and 116MB until OOM, max allowed footprint 85278080, growth limit 201326592
        at java.util.Arrays.copyOf(Arrays.java:3260)
        at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:125)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:605)
        at java.lang.StringBuilder.append(StringBuilder.java:191)
        at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1355)
        at org.kxml2.io.KXmlParser.next(KXmlParser.java:393)
        at org.kxml2.io.KXmlParser.next(KXmlParser.java:313)
        at org.kxml2.io.KXmlParser.nextText(KXmlParser.java:2077)

0 个答案:

没有答案