Escaper-Park / unofficial_chzzk_android_tv

비공식 치치직 안드로이드 TV 앱
44 stars 6 forks source link

[Fix] 안드로이드 Large Heap 설정 #10

Closed pontus-jeong closed 2 months ago

pontus-jeong commented 2 months ago

아이콘 많거나 vod 실행할 때 강제종료되는 오류가 있어서 현재 사용중인 ChromeCast HD에 adb 연결해서 실기기에서 테스트해보고, main.dart에 다음과 같은 코드를 넣어서 강제종료 오류를 확인했습니다.

FlutterError.onError = (details) {
    FlutterError.presentError(details);
  };

  PlatformDispatcher.instance.onError = (error, stack) {
    return true;
  };

그 결과 vod 실행할 때 나오는 오류가 다음과 같았습니다.

flutter Throwing OutOfMemoryError "Failed to allocate a 152 byte allocation with 11456 free bytes and 11KB until OOM, target footprint 134217728, growth limit 134217728; giving up on allocation because <1% of heap free after GC."

그래서 OutOfMemoryError쪽 확인해보니까 다음과 같은 해결 방법이 있었습니다.

https://github.com/flutter/flutter/issues/62118#issuecomment-1118444020

그래서 해당 방법대로 mainfast에 해당 코드를 추가하니 현재 테스트하면서 오류가 발생하지 않아 PR 올립니다.

Escaper-Park commented 2 months ago

치지직 vod response를 확인해보니 기존 mp4에서 hls가 추가되었네요(pc 버전에서는 hls로 재생 중). hls로 재생 방식 변경하면 large heap을 사용하지 않아도 될 것 같은데 우선 급한대로 수정해보겠습니다.

그리고 아이콘(이모티콘?) 관련 튕김 현상은 gif controller를 제거하고, repaint boundary를 사용하지 않는 것으로 퍼포먼스 향상을 할 수 있어서 수정했습니다. 그리고 gif cache 사용이 false로 되어있어서 그 부분을 true로 바꿔서 수정했습니다. 제가 지금 실물 기기를 테스트할 여건이 안돼서 에뮬레이터로 테스트 했는데 에뮬레이터로는 잘 실행되었습니다. 다만 debug 모드에서는 devtools 상 성능 테스트가 제대로 되지 않아서 체감상으로 테스트 했습니다.