question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not build complete responses in memory

See original GitHub issue

Many 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:open
  • Created 11 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
samueltardieucommented, Jun 20, 2012

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/

0reactions
kumycommented, Aug 28, 2017

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”

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found