microsoft / clarity-apps

Repo for distributing Clarity Apps packages
MIT License
46 stars 2 forks source link

[BUG][Android] Clarity Library causing OOM exceptions on Android #76

Open Davaeth opened 1 week ago

Davaeth commented 1 week ago

Describe the Bug We are getting Out Of Memory exceptions while users interacts with our product listing and product items. It started appearing right away when we added clarity library to app. We were forced to remove library from app for now.

Repro Steps we were not able to reproduce it ourselves, but our Crashlytics reports shown fast peaking OOM exceptions.

Expected Behavior Adding clarity library does not cause any exceptions.

Screenshots Image

Project Info E-commerce application

Platform/Framework Info

ibradwan commented 1 week ago

Hi @Davaeth,

Thanks for reporting this issue. Could u please share the full stack trace of the issue? Also, what's the frequency of the crashes? Finally, is your project imagery-heavy or uses large custom fonts?

m-szczepanowski commented 1 week ago

Hello, I am also involved in the project above. Our crashfree sessions fell by roughly 1% due to OOM crashes alone. The crashes were frequent enough that we had to release the app without Clarity. The project is an E-commerce application, so yes, we do have a lot of images. We also do have a few custom fonts included.

Here's the stack trace: Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 1832656 free bytes and 1789KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC. at java.lang.Long.valueOf(Long.java:1252) at com.microsoft.clarity.e.d.e(SourceFile:28) at android.view.ViewTreeObserver.dispatchOnDraw(ViewTreeObserver.java:1165) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5556) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5330) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4486) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3116) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10885) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309) at android.view.Choreographer.doCallbacks(Choreographer.java:923) at android.view.Choreographer.doFrame(Choreographer.java:852) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8757) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

ibradwan commented 1 week ago

Is this the same stack trace for all crashes? Would u also please send your project id to clarity-apps-support@microsoft.com?

m-szczepanowski commented 1 week ago

The stack trace isnt the same for each variant, and we have quite a few of those. I have sent the project id on the email provided.