oblador / react-native-animatable

Standard set of easy to use animations and declarative transitions for React Native
MIT License
9.84k stars 702 forks source link

Could not invoke RKTiming.createTimer #43

Open CrystalRanita opened 8 years ago

CrystalRanita commented 8 years ago

I kept image running over night but found an error occur: Could not invoke RKTiming.createTimer I am not sure this is react-native animated's issue or not.

Partial Code: I set iterationCount to infinite

And I also found that java heap keep increasing and does not release after error occur until I turn off AP, here is today's memory information: (Original Java Heap: 5648) $ adb shell dumpsys meminfo my_app_name Applications Memory Usage (kB): Uptime: 1207911780 Realtime: 1207911768 *\* MEMINFO in pid 28821 [com.acer.android.cybertool] ** Pss Private Private Swapped Heap Heap Heap Total Dirty Clean Dirty Size Alloc Free ------ ------ ------ ------ ------ ------ ------ Native Heap 18640 18560 0 0 33344 23223 10120 Dalvik Heap 188011 187860 0 0 194857 193459 1398 Dalvik Other 5329 5328 0 0 Stack 2940 2940 0 0 Ashmem 2 0 0 0 Gfx dev 7500 7364 0 0 Other dev 5 0 4 0 .so mmap 9071 484 5392 0 .apk mmap 332 0 4 0 .ttf mmap 101 0 20 0 .dex mmap 7376 8 7064 0 .oat mmap 2091 0 484 0 .art mmap 1158 732 4 0 Other mmap 173 8 100 0 EGL mtrack 39040 39040 0 0 Unknown 72617 72616 0 0 TOTAL 354386 334940 13072 0 228201 216682 11518 App Summary Pss(KB) ------ Java Heap: 188596 Native Heap: 18560 Code: 13456 Stack: 2940 Graphics: 46404 Private Other: 78056 System: 6374 ``` TOTAL: 354386 TOTAL SWAP (KB): 0 ``` Objects Views: 151 ViewRootImpl: 1 AppContexts: 2 Activities: 1 Assets: 3 AssetManagers: 2 Local Binders: 14 Proxy Binders: 19 Parcel memory: 7 Parcel count: 28 Death Recipients: 0 OpenSSL Sockets: 0 SQL MEMORY_USED: 99 PAGECACHE_OVERFLOW: 24 MALLOC_SIZE: 62 DATABASES pgsz dbsz Lookaside(b) cache Dbname 4 20 24 30/21/3 /data/user/0/com.acer.android.cybertool/databases/RKStorage
oblador commented 8 years ago

Seems like the infinite repeat count causes a memory leak. What I don't understand is why the leak is in Java and not JavaScript. Have you had a chance debugging this?

silverspace commented 8 years ago

FYI, I think this issue is related to RN / Fresco usage of Object.finalizer(): https://github.com/facebook/react-native/issues/8711 https://github.com/facebook/fresco/issues/1363

The issue occurs on Android when the finalizer queue fills up, and then objects stop being garbage collected: https://code.google.com/p/android/issues/detail?id=215906