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.

Server crash with OOM

See original GitHub issue

While trying Espresso on one of our app, on a screens which have a lot of elements in the hierarchy, finding by XPath brings down Espresso server with Out Of Memory. The Xpath was {:xpath=>"//*[@text='Loading...']"}.

Same thing happens when I try to get page source on that screen

--------- beginning of crash
12-11 16:36:04.147 28992 29515 E AndroidRuntime: FATAL EXCEPTION: NanoHttpd Request Processor (#20)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: Process: com.bumble.app, PID: 28992
12-11 16:36:04.147 28992 29515 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 268501000 byte allocation with 6291456 free bytes and 179MB until OOM, max allowed footprint 153800280, growth limit 335544320
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.util.Arrays.copyOf(Arrays.java:3260)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:125)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:605)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.lang.StringBuffer.append(StringBuffer.java:367)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.io.StringWriter.write(StringWriter.java:94)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at org.kxml2.io.KXmlSerializer.flushBuffer(KXmlSerializer.java:80)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at org.kxml2.io.KXmlSerializer.append(KXmlSerializer.java:53)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at org.kxml2.io.KXmlSerializer.attribute(KXmlSerializer.java:496)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:172)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.serializeView(SourceDocument.java:179)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.toXMLString(SourceDocument.java:197)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.model.SourceDocument.findViewsByXPath(SourceDocument.java:212)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.viewmatcher.WithXPath.withXPath(WithXPath.java:35)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.viewmatcher.WithXPath.withXPath(WithXPath.java:57)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.helpers.ViewFinder.findAllBy(ViewFinder.java:180)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.helpers.ViewFinder.findAllBy(ViewFinder.java:113)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.handlers.FindElements.handle(FindElements.java:48)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.handlers.FindElements.handle(FindElements.java:33)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.http.Router.route(Router.java:296)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at io.appium.espressoserver.lib.http.Server.serve(Server.java:68)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
12-11 16:36:04.147 28992 29515 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:764)
12-11 16:36:04.188  1373  1373 E SELinux : avc:  denied  { find } for interface=android.hardware.memtrack::IMemtrack pid=28992 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:hal_memtrack_hwservice:s0 tclass=hwservice_manager
12-11 16:36:04.188 28992 29515 E memtrack: Couldn't load memtrack module
12-11 16:36:04.189 28992 29515 W android.os.Debug: failed to get memory consumption info: -1
12-11 16:36:04.197 28992 29515 I Process : Sending signal. PID: 28992 SIG: 9
12-11 16:36:04.326  1700 12120 I WindowManager: WIN DEATH: Window{3882189 u0 com.bumble.app/com.bumble.app.ui.main.AppMainActivity}
12-11 16:36:04.328  1700 13524 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=39, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@56111c6)
12-11 16:36:04.328  1700  5090 I ActivityManager: Process com.bumble.app (pid 28992) has died: fore TOP
12-11 16:36:04.332  1700  5090 W ActivityManager: Force removing ActivityRecord{2eac9c7 u0 com.bumble.app/.ui.main.AppMainActivity t317}: app died, no saved state
12-11 16:36:04.334 29043 29043 I cr_ChildProcessService: Destroying ChildProcessService pid=29043
12-11 16:36:04.339 29043 29043 I /system/bin/webview_zygote32: System.exit called, status: 0
12-11 16:36:04.339 29043 29043 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
12-11 16:36:04.339  1700  1788 E ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ LISTEN id=39, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ]
12-11 16:36:04.352  1700  5090 W ActivityManager: Crash of app com.bumble.app running instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Dec 12, 2018

Published the fix in 1.5.0

1reaction
mykola-mokhnachcommented, Dec 11, 2018

@dpgraham I think the problem there is the same as it was for UIA2. We should simply limit the maximum depth of views hierarchy traversal. I’ll prepare a hot fix soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

HELP server crashes with exit code 137 (oom-killer) How to fix!!!
Lower your allocated heap size, currently it's higher than what you can allocate which causes that crash to happen.
Read more >
PI72163: DEPLOYMENT MANAGER CRASHES WITH OOM ...
An out-of-memory condition occurs when an application containing a large number of EJBs is deployed.
Read more >
Server killed by OOM (was: crash caused by Memory limit ...
i user docker start clcikhosue.when a query use memory is larger ,clickhosue will crash.i have set ...
Read more >
Server crashing because of out of memory
My server crashed 3 times in the last week from out of memory. ... swap should be RAMx.2 for 20%, better to survive...
Read more >
Server crashing with OOM error - Support - Minecraft Forum
I am running into problems with my minecraft server crashing with out of memory errors. The following is in the logs: [17:19:03] [Server...
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