0

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.

Daniel
  • 2,355
  • 9
  • 23
  • 30
Rafael
  • 79
  • 1
  • 4
  • Do you still experience the issue without largeHeap enabled? I'm having the same issue... – davehenry Jun 06 '16 at 16:30
  • Yes, I added the largeHeap after the problem, but no works yet. – Rafael Jun 06 '16 at 16:45
  • Okay, thats the same as my issue. Have you added or updated any dependencies recently? – davehenry Jun 06 '16 at 17:17
  • The VM wants to allocate 1.7GB heap. Seems you want to load a big file to heap. Can you check what you want to read in this moment? – Konrad Jun 06 '16 at 17:33
  • Thank you for everything, I will apply the alternatives and test the program. – Rafael Jun 06 '16 at 18:57
  • Konrad, I only send the values of location and accelerometer. davehenry, try this: http://stackoverflow.com/questions/24095909/volley-out-of-memory-error-weird-allocation-attempt – Rafael Jun 06 '16 at 19:05

0 Answers0