> While testing my AI Voice Assistant UI (LiveK...
# ask-ai
p
While testing my AI Voice Assistant UI (LiveKit) in React Native, I noticed that on lower iOS versions (like iOS 13), the app crashes after running for 10–12 minutes. The crash happens because the JS heap memory size grows to around 90 MB. However, the app works fine on iOS 14 and above.
t
Thanks for reaching out, Vishal. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you share a bit more about the LiveKit features or components you're using in your React Native app? Like, are you working with audio/video streaming, data channels, or maybe some other specific parts? Understanding this will really help us figure out what might be causing the memory issue. Sources: Community & Support | livekit/livekit_composite | DeepWiki | docs/index.html | Documentation/iOSInstallation.md
p
Audio Voice to Voice
t
Hey there! If you're running into memory issues while streaming audio with LiveKit on iOS 13, here are some friendly tips to help you out: • Make sure to clean up properly: Double-check that all LiveKit parts—like rooms and tracks—are disconnected and released when you’re done with them. This little step can really help avoid memory leaks. • Tweak your audio session settings: Setting up the iOS audio session just right can save resources. Try picking the right audio category and mode that fits what your app needs. • Keep an eye on memory usage: Tools like Xcode’s Instruments are great for spotting where memory might be slipping away or piling up too much. • Stay updated: Make sure you’re using the latest LiveKit React Native SDK. Updates often bring handy performance boosts and fix pesky bugs. • Test specifically on iOS 13: Since this issue pops up on iOS 13, give your app a good spin on that version to catch any patterns or triggers causing the memory to grow. If you’re still stuck after trying these, it might be worth digging into React Native memory optimization tricks or reaching out to the LiveKit community—they’re usually pretty helpful!
p
Even after commenting out all event listeners and only initializing the LiveKit room, the app still crashes on iOS 13 after about 10–13 minutes.
t
Hey there! Since the issue is still happening even with minimal LiveKit room setup, here are a few friendly steps you can try to narrow things down and hopefully get it sorted: • Audio Session Management: Make sure you’re calling
AudioSession.stopAudioSession()
when you disconnect from the room, and that the
LiveKitRoom
component is properly unmounted. This can really help clean things up. • Test on Other iOS Versions: It’s a good idea to check if this happens on iOS versions newer than 13, just to see if it’s something specific to iOS 13. • Use the Example App: Try running the official LiveKit React Native example app on iOS 13 to see if the issue pops up there too. • Profile Memory Usage: If you’re comfortable with Xcode, use Instruments to keep an eye on memory allocation during room initialization. This might reveal any leaks or heavy usage causing trouble. These steps should help us figure out if it’s about cleanup, an iOS 13 quirk, or something with the SDK itself. If you want, I’m here to walk you through any of these—just let me know! Sources: Documentation/iOSInstallation.md | ci/ios/Podfile.lock | ios/Podfile.lock
p
I am not changing any screen i am on the same screen only continuesouly using for 10-13 mins
t
It sounds like the memory issue pops up after hanging out on the same screen for about 10–13 minutes, which could mean there’s some resource buildup or a memory leak happening. Here are a few friendly tips to help you dig in and tackle this: • Keep an Eye on Resource Usage: Try using Xcode’s Instruments to watch memory and CPU use over time while your app runs. See if memory slowly creeps up. • Double-Check for Unreleased Resources: Make sure all your event listeners, timers, and intervals get cleaned up properly—even if you’re just staying put on one screen. • Streamline Audio Streaming: Check that audio tracks aren’t being duplicated or restarted when they don’t need to be. Ideally, only one audio track should be playing at once. • Test with a Simple Setup: Build a minimal test case with just the LiveKit room and audio streaming to see if the problem still shows up. This can help pinpoint what’s going on. • Keep Your SDK Updated: Make sure you’re on the latest LiveKit React Native SDK version since updates often fix memory issues. If you’re still running into trouble, profiling your app with Instruments can give you a clearer picture of what’s causing the memory to grow. Feel free to reach out if you want a hand using these tools or need more help—I’m here for you!
p
Do I need to change my room after 10-15 mins converstion continusely
are you there
t
Good news! You don’t need to reinitialize or change LiveKit rooms after 10–15 minutes of continuous use. LiveKit rooms are built to stay active as long as you’re connected, so there’s no need for any periodic restarts during normal use. If you’re running into any problems, it’s probably due to resource management or a specific limitation with iOS 13. To help sort things out, try cleaning up resources properly, keeping an eye on memory usage, and making sure you’re using the latest SDK version. We’re here to help if you need any more tips! Sources: Avoiding Room ID Reuse When Re-Creating Rooms With the Same Name | docs/index.html