Do not build complete responses in memory
See original GitHub issueMany crashes are linked to OutOfMemoryError
on low-end devices due to the fact that we systematically store responses in strings, whereas we could process them as a stream. This is due to our all-regex approach, which could be replaced in many cases by a sax-like parser such as the one from tagsoup. That would not require storing whole web pages in memory.
java.lang.OutOfMemoryError: (Heap Size=11719KB, Allocated=6276KB, Bitmap Size=7969KB)
at ch.boye.httpclientandroidlib.util.CharArrayBuffer.expand(CharArrayBuffer.java:63)
at ch.boye.httpclientandroidlib.util.CharArrayBuffer.append(CharArrayBuffer.java:93)
at android.support.v4.app.ActivityCompatHoneycomb.toString(RequiredFields.java:225)
at cgeo.geocaching.network.Network.getResponseDataNoError(Network.java:371)
at cgeo.geocaching.network.Network.getResponseData(Network.java:387)
at cgeo.geocaching.network.Network.getResponseData(Network.java:380)
at cgeo.geocaching.connector.gc.Login.switchToEnglish(Login.java:221)
at cgeo.geocaching.connector.gc.Login.login(Login.java:87)
at cgeo.geocaching.cgeo$firstLogin.run(cgeo.java:825)
Issue Analytics
- State:
- Created 11 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Memory Systems Do Not Divide on Consciousness - NCBI - NIH
There is a popular hypothesis that performance on implicit and explicit memory tasks reflects 2 distinct memory systems. Explicit memory is said to...
Read more >Dissociative Amnesia: Symptoms, Causes, Management ...
Dissociative amnesia can happen when a person goes through extremely stressful or traumatic events, which cause a loss of memory.
Read more >Memory Recognition and Recall in User Interfaces
Recognition is easier than recall because it involves more cues: all those cues spread activation to related information in memory, raise the ...
Read more >The Influences of Emotion on Learning and Memory - Frontiers
However, stress and emotion do not always induce strong memories of new information. Indeed, they have also been reported to inhibit WM and...
Read more >Learning and Memory (Section 4, Chapter 7) Neuroscience ...
In summary, memory is not stored in a single place in the brain. ... One has the potential of working out the complete...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, I think that we should not use regular expressions at all to parse HTML pages. We should use something like TagSoup instead: http://ccil.org/~cowan/XML/tagsoup/
Jsoup is only used in some (small) parts, and there are still many regex used 😦. we should keep the issue and probably rename it to “Use a dom parser instead of Regex”