I kept running my app and after an hour he quit on his own, then I checked the memory and I found that the app's memory kept increasing.
C:\Users\Administrator\Downloads>adb shell dumpsys meminfo com.test.demo
Applications Memory Usage (kB):
Uptime: 23167729 Realtime: 23167729
** MEMINFO in pid 28468 [com.test.demo] **
Pss Private Private Swapped Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 0 0 0 0 27472 27373 98
Dalvik Heap 51611 51460 0 0 54136 45971 8165
Dalvik Other 3978 3788 0 0
Stack 172 172 0 0
Other dev 5 0 4 0
.so mmap 2220 824 324 0
.apk mmap 435 0 256 0
.ttf mmap 1076 0 692 0
.dex mmap 8915 732 6788 0
Other mmap 1004 4 916 0
Unknown 25856 25832 0 0
TOTAL 95272 82812 8980 0 81608 73344 8263
Objects
Views: 165 ViewRootImpl: 1
AppContexts: 3 Activities: 1
Assets: 2 AssetManagers: 2
Local Binders: 16 Proxy Binders: 19
Death Recipients: 0
OpenSSL Sockets: 0
SQL
MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
C:\Users\Administrator\Downloads>adb shell dumpsys meminfo com.test.demo
Applications Memory Usage (kB):
Uptime: 23432898 Realtime: 23432898
** MEMINFO in pid 28468 [com.test.demo] **
Pss Private Private Swapped Heap Heap Heap
Total Dirty Clean Dirty Size Alloc Free
------ ------ ------ ------ ------ ------ ------
Native Heap 0 0 0 0 43840 43700 139
Dalvik Heap 51611 51460 0 0 54136 45196 8940
Dalvik Other 3982 3792 0 0
Stack 164 164 0 0
Other dev 5 0 4 0
.so mmap 2220 824 324 0
.apk mmap 435 0 256 0
.ttf mmap 1076 0 692 0
.dex mmap 8918 732 6792 0
Other mmap 188 4 100 0
Unknown 42196 42172 0 0
TOTAL 110795 99148 8168 0 97976 88896 9079
Objects
Views: 165 ViewRootImpl: 1
AppContexts: 3 Activities: 1
Assets: 2 AssetManagers: 2
Local Binders: 16 Proxy Binders: 19
Death Recipients: 0
OpenSSL Sockets: 0
SQL
MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
C:\Users\Administrator\Downloads>adb shell
root@Hi3798MV100:/ # adb shell top -d 2 | grep com.test.demo
28468 1 30% R 32 497168K 167668K fg u0_a19 com.test.demo
28468 2 30% R 32 497300K 167932K fg u0_a19 com.test.demo
28468 1 29% R 32 497432K 167932K fg u0_a19 com.test.demo
28468 1 30% R 32 497564K 168196K fg u0_a19 com.test.demo
^C
130|root@Hi3798MV100:/ # adb shell top -d 1 | grep com.test.demo
28468 3 27% R 32 498224K 168724K fg u0_a19 com.test.demo
28468 2 30% R 32 498356K 168724K fg u0_a19 com.test.demo
28468 3 33% R 32 498356K 168988K fg u0_a19 com.test.demo
28468 3 29% R 32 498488K 168988K fg u0_a19 com.test.demo
28468 3 30% R 32 498488K 168988K fg u0_a19 com.test.demo
28468 3 30% R 32 498620K 168988K fg u0_a19 com.test.demo
^C
130|root@Hi3798MV100:/ # adb shell top -d 5 | grep com.test.demo
28468 2 30% R 32 499412K 170044K fg u0_a19 com.test.demo
28468 2 30% R 32 499808K 170308K fg u0_a19 com.test.demo
28468 0 30% R 32 500072K 170572K fg u0_a19 com.test.demo
28468 0 30% R 32 500336K 170836K fg u0_a19 com.test.demo
28468 2 30% R 31 499692K 171104K fg u0_a19 com.test.demo
28468 3 30% R 31 499956K 171368K fg u0_a19 com.test.demo
28468 1 30% R 30 499180K 171892K fg u0_a19 com.test.demo
28468 1 30% R 30 499576K 172156K fg u0_a19 com.test.demo
28468 1 30% R 30 499840K 172420K fg u0_a19 com.test.demo
28468 3 29% R 30 500104K 172684K fg u0_a19 com.test.demo
28468 2 31% R 30 500500K 172948K fg u0_a19 com.test.demo
28468 2 29% R 30 500764K 173212K fg u0_a19 com.test.demo
28468 2 31% R 30 501028K 173740K fg u0_a19 com.test.demo
28468 3 29% R 30 501424K 174004K fg u0_a19 com.test.demo
28468 3 31% R 30 501688K 174268K fg u0_a19 com.test.demo
28468 0 30% R 30 501952K 174532K fg u0_a19 com.test.demo
28468 0 30% R 30 502216K 174796K fg u0_a19 com.test.demo
28468 0 30% R 30 502612K 175060K fg u0_a19 com.test.demo
28468 1 30% R 30 502876K 175588K fg u0_a19 com.test.demo
28468 3 29% R 30 503140K 175852K fg u0_a19 com.test.demo
28468 3 30% R 30 503536K 176116K fg u0_a19 com.test.demo
28468 0 30% R 30 503800K 176380K fg u0_a19 com.test.demo
28468 3 30% R 30 504064K 176644K fg u0_a19 com.test.demo
28468 0 30% R 30 504460K 176908K fg u0_a19 com.test.demo
28468 0 30% R 30 504724K 177172K fg u0_a19 com.test.demo
28468 3 30% R 30 504988K 177700K fg u0_a19 com.test.demo
28468 3 30% R 30 505384K 177964K fg u0_a19 com.test.demo
28468 3 31% R 30 505648K 178228K fg u0_a19 com.test.demo
28468 0 29% R 30 505912K 178492K fg u0_a19 com.test.demo
28468 3 31% R 30 506308K 178756K fg u0_a19 com.test.demo
28468 1 29% R 30 506572K 179020K fg u0_a19 com.test.demo
28468 1 31% R 30 506836K 179548K fg u0_a19 com.test.demo
28468 3 30% R 30 507232K 179812K fg u0_a19 com.test.demo
28468 3 30% R 30 507496K 180076K fg u0_a19 com.test.demo
28468 3 30% R 30 507760K 180340K fg u0_a19 com.test.demo
28468 3 30% R 30 508156K 180604K fg u0_a19 com.test.demo
28468 0 30% R 30 508420K 180868K fg u0_a19 com.test.demo
28468 3 30% R 30 508684K 181396K fg u0_a19 com.test.demo
28468 1 30% R 30 509080K 181660K fg u0_a19 com.test.demo
28468 1 30% R 30 509344K 181924K fg u0_a19 com.test.demo
28468 1 30% R 30 509608K 182188K fg u0_a19 com.test.demo
28468 1 30% R 30 510004K 182452K fg u0_a19 com.test.demo
28468 1 30% R 30 510268K 182716K fg u0_a19 com.test.demo
28468 1 30% R 30 510532K 183244K fg u0_a19 com.test.demo
28468 1 31% R 30 510796K 183508K fg u0_a19 com.test.demo
28468 1 30% R 30 511192K 183772K fg u0_a19 com.test.demo
28468 1 31% R 30 511456K 184036K fg u0_a19 com.test.demo
28468 1 29% R 30 511720K 184300K fg u0_a19 com.test.demo
28468 1 31% R 30 512116K 184564K fg u0_a19 com.test.demo
28468 3 29% R 30 512380K 185092K fg u0_a19 com.test.demo
28468 3 31% R 30 512644K 185356K fg u0_a19 com.test.demo
28468 0 30% R 30 513040K 185620K fg u0_a19 com.test.demo
28468 1 30% R 30 513304K 185884K fg u0_a19 com.test.demo
28468 3 30% R 30 513568K 186148K fg u0_a19 com.test.demo
28468 0 30% R 30 513964K 186516K fg u0_a19 com.test.demo
28468 0 30% R 30 514228K 186776K fg u0_a19 com.test.demo
28468 2 30% R 30 514492K 187040K fg u0_a19 com.test.demo
28468 3 30% R 30 514888K 187568K fg u0_a19 com.test.demo
28468 1 30% R 30 515152K 187832K fg u0_a19 com.test.demo
28468 3 30% R 30 515548K 188096K fg u0_a19 com.test.demo
28468 3 30% R 30 515812K 188360K fg u0_a19 com.test.demo
28468 3 30% R 30 516076K 188624K fg u0_a19 com.test.demo
28468 2 29% R 30 516472K 188888K fg u0_a19 com.test.demo
28468 2 31% R 29 515696K 189412K fg u0_a19 com.test.demo
28468 3 29% R 29 515960K 189676K fg u0_a19 com.test.demo
28468 2 31% R 29 516356K 189940K fg u0_a19 com.test.demo
^C
130|root@Hi3798MV100:/ #
C:\Users\Administrator\Downloads>
I kept running my app and after an hour he quit on his own, then I checked the memory and I found that the app's memory kept increasing.