java.lang.OutOfMemoryError volley DiskBasedCache

时间:2016-06-06 16:27:44

标签: java android android-studio out-of-memory android-volley

我的应用程序有一个与我的Android设备一起启动的服务。 此服务获取位置(LocationListener)和一些传感器(SensorEventListener)的更改并将其发送到我的数据库(PHP + MySQL)。

我已添加到我的清单中:

    android:largeHeap="true"

经过长时间工作(几个小时)后,应用程序将关闭。根据logcat中的错误详细信息,我获得了以下信息:

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)

欢迎任何帮助,谢谢。

0 个答案:

没有答案