Out of memory error in DJI log
CompletedI'm seeing a lot of out of memory errors on the RC Pro when running our MSDK app. Our app may be creating the memory pressure, but the actual OOM appears to always originate from the DJILogFIleManager. Is there any way to reduce the DJILogFileManager's memory demands?
04-05 10:41:45.065 4935 7172 E AndroidRuntime: FATAL EXCEPTION: DJI Log #2
04-05 10:41:45.065 4935 7172 E AndroidRuntime: Process: com.blah.blah.blah, PID: 4935
04-05 10:41:45.065 4935 7172 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 74630640 byte allocation with 6291456 free bytes and 43MB until OOM, target footprint 228605152, growth limit 268435456
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.util.Arrays.copyOf(Arrays.java:3257)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.lang.StringBuilder.append(StringBuilder.java:137)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at dji.log.co_i$co_a.run(DJILogFileManager.java:8)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
04-05 10:41:45.065 4935 7172 E AndroidRuntime: at java.lang.Thread.run(Thread.java:919)
-
I will investigate further, but it seems strange to me that the DJI log should consume more than 70 MB of memory on a device which is memory-constrained. Is there an upper limit to what the DJILogFileManager will try to consume so that we can ensure we don't merely postpone the crash?
-
I thought that the behaviour was improved a bit by deleting by deleting the logs from `files/DJI/LOG/CACHE/`.
I have tried to replicate the issue in the sample app, but it is not as straightforwards as it seems to be quite tightly coupled with flying large missions, and have not yet had any luck loading my KMZ in the sample app.
In our app, the log appears to increase quite slowly and remain in the tens of kB for a long time until I fly a mission, but once a mission is started it begins to grow at a rate of over 100MB per minute, so it is quite easy to end up with a log that is in the many hundreds of MB big or bigger. Is it possible to reduce the verbosity of these logs? Have you flown a large mission in the sample app with e.g. more than 50 waypoints?
Please sign in to leave a comment.
Comments
7 comments