My application has a service that starts together with my android device. This service takes the changes in position (LocationListener) and some sensors (SensorEventListener) and sends it to my database (PHP + MySQL).
I've added in my Manifest:
android:largeHeap="true"
After a long time working (a few hours), the application is closed. Following the error details in logcat, I obtained the following information:
06-05 19:59:26.137 11097-11129/com.example.cube.teste I/art: Alloc sticky concurrent mark sweep GC freed 13129(2033KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 29MB/37MB, paused 870us total 20.483ms
06-05 19:59:26.149 11097-11129/com.example.cube.teste I/art: Alloc partial concurrent mark sweep GC freed 326(26KB) AllocSpace objects, 0(0B) LOS objects, 35% free, 29MB/45MB, paused 1.041ms total 11.397ms
06-05 19:59:26.166 11097-11129/com.example.cube.teste I/art: Alloc concurrent mark sweep GC freed 21(12KB) AllocSpace objects, 0(0B) LOS objects, 35% free, 29MB/45MB, paused 769us total 17.344ms
06-05 19:59:26.166 11097-11129/com.example.cube.teste I/art: Forcing collection of SoftReferences for 1GB allocation
06-05 19:59:26.182 11097-11129/com.example.cube.teste I/art: Alloc concurrent mark sweep GC freed 11(344B) AllocSpace objects, 0(0B) LOS objects, 35% free, 29MB/45MB, paused 974us total 15.900ms
06-05 19:59:26.182 11097-11129/com.example.cube.teste E/art: Throwing OutOfMemoryError "Failed to allocate a 1751343484 byte allocation with 16777216 free bytes and 482MB until OOM"
06-05 19:59:26.183 11097-11129/com.example.cube.teste E/AndroidRuntime: FATAL EXCEPTION: Thread-931
Process: com.example.cube.teste, PID: 11097
java.lang.OutOfMemoryError: Failed to allocate a 1751343484 byte allocation with 16777216 free bytes and 482MB until OOM
at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316)
at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526)
at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:548)
at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:392)
at com.android.volley.toolbox.DiskBasedCache.initialize(DiskBasedCache.java:155)
at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:84)
Any help is welcome, thanks.