title: App Crash when observing a Live Data in Jetpack Compose Composable due to memory issue
body: <p>I have one <code>Composable</code> which has one <code>Callback</code> function which is responsible to perform some action based on value it is observing in <code>ViewModel</code>. The Composable looks like.</p>
  <pre><code>@Composable
  fun MyComposable(
      viewModel: MyViewModel = hiltViewModel(),
      navigateToSecondScreen: () -&gt; Unit
  ) {
      val stateFlow by viewModel._screenState.collectAsState()
      val apiSuccess by viewModel.apiCallSuccess.observeAsState(initial = false)
      if(apiSuccess){
          navigateToSecondScreen()
      }
    }
  </code></pre>
  <p>The Composable is called in this way</p>
  <pre><code>MyComposable(viewModel = myViewModel, navigateToSecondScreen = {
                  // action for navigation
  })
  </code></pre>
  <p>The <code>apiSuccess</code> is a LiveData inside <code>ViewModel</code> whose value is updated after Api Call is success in this way</p>
  <pre><code>    private val _sendingOtpSuccess: MutableLiveData&lt;Boolean&gt; = MutableLiveData()
          val sendingOtpSuccess: LiveData&lt;Boolean&gt; = _sendingOtpSuccess
          viewModelScope.launch {
                      myRepository.makeApiCall(argument = argument).collect { responseState  -&gt;
                          when (responseState) {
                              is ResponseState.Loading -&gt; {
                                  
                              }
                              is ResponseState.Success -&gt; {
                                  _sendingOtpSuccess.value = true
                                      
                              }
                              is ResponseState.Error -&gt; {
                                  
                              }
                          }
                      }
                  } 
  </code></pre>
  <p>I got this error</p>
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
      Process: co.myProject.compose, PID: 10904
      java.lang.OutOfMemoryError: Failed to allocate a 10383376 byte allocation with 6291456 free bytes and 8530KB until OOM, target footprint 47887792, growth limit 50331648
  </code></pre>
  <p>With this above code when Api Call is Success the Composable keep continue observing and after some time App gets crashed showing memory issue. What is going wrong here ? Any help will be appreciated</p>