android.os.TransactionTooLargeException

2012. 6. 3. 18:06·Android Development
반응형

바인더가 처리할 양이 너무 커서 나타나는 exception 이다. 

보통 1mb 이내에 처리가 되어야 하는데 그 크기가 넘어서 생기는 문제이다. 

보통 쿼리를 던지거나 Parcel 로 큰 값을 던지는 경우에 발생한다. 

처리하는 부분을 다시 다듬어서 불필요하게 버퍼를 차지하는지 확인이 필요하다.

 

이하 내용은 좀 더 간략한 overview 이다. 


The Binder transaction failed because it was too large.

During a remote procedure call, the arguments and the return value of the call are transferred as Parcel objects stored in the Binder transaction buffer. If the arguments or the return value are too large to fit in the transaction buffer, then the call will fail and TransactionTooLargeException will be thrown.

The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size.

There are two possible outcomes when a remote procedure call throws TransactionTooLargeException. Either the client was unable to send its request to the service (most likely if the arguments were too large to fit in the transaction buffer), or the service was unable to send its response back to the client (most likely if the return value was too large to fit in the transaction buffer). It is not possible to tell which of these outcomes actually occurred. The client should assume that a partial failure occurred.

The key to avoiding TransactionTooLargeException is to keep all transactions relatively small. Try to minimize the amount of memory needed to create a Parcel for the arguments and the return value of the remote procedure call. Avoid transferring huge arrays of strings or large bitmaps. If possible, try to break up big requests into smaller pieces.

If you are implementing a service, it may help to impose size or complexity contraints on the queries that clients can perform. For example, if the result set could become large, then don't allow the client to request more than a few records at a time. Alternately, instead of returning all of the available data all at once, return the essential information first and make the client ask for additional information later as needed.


출처 : http://developer.android.com/reference/android/os/TransactionTooLargeException.html

 

TransactionTooLargeException  |  API reference  |  Android Developers

 

developer.android.com

 

저작자표시 비영리 변경금지 (새창열림)

'Android Development' 카테고리의 다른 글

ANT build System을 통한 Android APK 빌드하기  (0) 2012.06.25
[MAT] Memory leak analysis tool  (0) 2012.06.08
ListView setTextFilterEnabled  (0) 2012.05.02
Source Insight + GVIM  (0) 2012.03.30
fragment 와 orientation  (0) 2012.03.26
'Android Development' 카테고리의 다른 글
  • ANT build System을 통한 Android APK 빌드하기
  • [MAT] Memory leak analysis tool
  • ListView setTextFilterEnabled
  • Source Insight + GVIM
fogthegreat
fogthegreat
아주 오랫동안 이것 저것 개발하면서 배우고 찾아 본 것들을 적거나 모았습니다. 불편한 점이 있다면 알려주세요. (과거에 불펌한 글들을 모두 제거하고 있는 중이에요. 🙏)
  • fogthegreat
    꿈소년의 개발 이야기
    fogthegreat
  • 전체
    오늘
    어제
    • 전체보기 (242)
      • Software Engineering (56)
      • Android Development (78)
      • 일상다반사 (63)
      • 책에 대한 거의 모든 것 (11)
      • 영어공부 (1)
      • ETC (0)
      • 챌린지 (1)
      • Do it 스터디! (32)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 향로
    • 청하가 제안하는 소프트웨어 엔지니어로써 재미있게 사는 …
    • WhoRU? Story...♡
    • Snapshot
    • 두잇! - 이지스퍼블리싱
    • 제이펍의 참 똑똑한 2비트 책 이야기
    • Inpa Dev
  • 공지사항

  • 인기 글

  • 태그

    코틀린
    C++
    안드로이드 개발
    보안
    개발
    OOM
    linux
    리눅스
    Android 4.1
    안드로이드
    노개북
    css
    hcj
    build.gradle
    git
    구글
    google
    JavaScript
    js
    탐지기법
    java
    kotlin
    하버드
    html
    ActiveX
    안철수
    자바
    Android
    gradle
    Eclipse
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
fogthegreat
android.os.TransactionTooLargeException
상단으로

티스토리툴바