Skip to content

Twilio memory leak #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
benji-cl opened this issue Feb 6, 2025 · 0 comments
Open

Twilio memory leak #60

benji-cl opened this issue Feb 6, 2025 · 0 comments

Comments

@benji-cl
Copy link

benji-cl commented Feb 6, 2025

I was running a test on my app to make sure it was scalable. This involved simulating 100 users sending chats every ~10s. After 20 mins, it consumed enough memory to impact other services and functions on the app. After 30 minutes, the app crashed. When I open the app again and look at the chat, it crashes after trying to retrieve a few batches of messages using .getLastMessages(20) and .getMessagesBefore(pageInfo.lastReadIndex, 20). This is the error message I'm seeing. The sdk doesn't seem to have a way to cleanup older messages from local memory.

JNI ERROR (app bug): global reference table overflow (max=51200)global reference table dump: Last 10 entries (of 51199): 51198: 0x161412f8 com.twilio.conversations.internal.CallbackListenerForwarder 51197: 0x161412f8 com.twilio.conversations.internal.CallbackListenerForwarder 51196: 0x161412f8 com.twilio.conversations.internal.CallbackListenerForwarder 51195: 0x1600a938 com.twilio.conversations.internal.CallbackListenerForwarder 51194: 0x1600a920 com.twilio.conversations.twilsock.JniFuture 51193: 0x1600a910 com.twilio.conversations.internal.CallbackListenerForwarder 51192: 0x1600a8f8 com.twilio.conversations.twilsock.JniFuture 51191: 0x1b0001d8 com.twilio.conversations.MessageImpl 51190: 0x1b040000 com.twilio.conversations.MessageImpl 51189: 0x1600a8e8 com.twilio.conversations.internal.CallbackListenerForwarder Summary: 50222 of com.twilio.conversations.MessageImpl (50222 unique instances) 516 of java.lang.Class (417 unique instances) 173 of com.twilio.conversations.ParticipantImpl (173 unique instances) 102 of com.twilio.conversations.UserImpl (102 unique instances) 16 of java.lang.ref.WeakReference (14 unique instances) 12 of android.app.LoadedApk$ReceiverDispatcher$InnerReceiver (12 unique instances) 10 of com.twilio.conversations.internal.CallbackListenerForwarder (5 unique instances) 10 of com.twilio.conversations.ConversationImpl (10 unique instances) 6 of android.os.Binder (6 unique instances) 5 of org.chromium.mojo.system.impl.WatcherImpl (5 unique instances) 5 of android.app.LoadedApk$ServiceDispatcher$InnerConnection (5 unique instances) 5 of android.content.ContentProvider$Transport (5 unique instances) 5 of android.os.Handler$MessengerImpl (5 unique instances) 5 of java.nio.DirectByteBuffer (5 unique instances) 4 of com.twilio.conversations.ConversationsClientImpl (2 unique instances) 4 of com.twilio.conversations.twilsock.JniFuture (4 unique instances) 3 of java.lang.String (2 unique instances) 3 of dalvik.system.PathClassLoader (2 unique instances) 3 of android.database.ContentObserver$Transport (3 unique instances) 3 of android.view.inputmethod.RemoteInputConnectionImpl (3 unique instances) 3 of android.app.LoadedApk$ServiceDispatcher$DeathMonitor (3 unique instances) 2 of android.hardware.camera2.CameraManager$CameraManagerGlobal (1 unique instances) 2 of android.view.ThreadedRenderer$WebViewOverlayProvider (1 unique instances) 2 of com.twilio.conversations.twilsock.TwilsockWrapper (2 unique instances) 2 of com.twilio.conversations.Conversations (2 unique instances) 2 of com.twilio.conversations.internal.ConversationsClientListenerForwarder (2 unique instances) 2 of com.twilio.conversations.ConversationsClientImpl$2 (2 unique instances) 2 of org.chromium.base.JavaHandlerThread (2 unique instances) 2 of android.view.ViewRootImpl$W (2 unique instances) 2 of int[](16 elements) (2 unique instances)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant