Out of memory error in DJI log

Completed

Comments

7 comments

  • DJI Developer Support
    The crash happens because the SDK tries to allocate the memory in DJI log. You need to find the root case of why the memory is in shortage. Currently we don't want to change the DJILogFileManager as long as the sample doesn't crash.
    0
    Comment actions Permalink
  • Alexis Glass

    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?

    0
    Comment actions Permalink
  • DJI Developer Support
    No, the DJILogFileManager will keep consuming the memory as it will continue write log when your app is activated. You can clear the log periodicly, it is inside your app folder.
    0
    Comment actions Permalink
  • Alexis Glass

    Thank you, we'll see if that makes a difference.

    0
    Comment actions Permalink
  • Alexis Glass

    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?

    0
    Comment actions Permalink
  • DJI Developer Support
    We will try to optimise the log for sure in the next version. Thanks for giving hint about file/DJI/LOG/CACHE. It reminds us there should be a memory control issue when writing logs after starting the mission.
    0
    Comment actions Permalink
  • DJI Developer Support
    This issue has been fixed in version 5.4. We provide an interface for controlling the writing of logs, it is LogUtils.setIsWriteLog.
    0
    Comment actions Permalink

Please sign in to leave a comment.