title: Out of memory - Android
body: <p>I'm using ffmpeg in my Android application and sometimes I'm getting out of memory error, I'm calling the ffmpeg inside a HandlerThread, is it ok to catch out of memory error and exit the thread while the main thread keeps on running?</p>
  
  <p>I read a lot of this being not a good practice, the thing is that I really need that because I have to edit the DB when there is any kind of error</p>
  
  <pre><code>    fc = new FfmpegController(context, fileTmp);
      try {
  
          fc.processVideo(clip_in, clip_out, false,
                  new ShellUtils.ShellCallback() {
  
                      @Override
                      public void shellOut(String shellLine) {
  
  
                      }
  
                      @Override
                      public void processComplete(int exitValue) {
                           //Update the DB  
                      }
                  });
      } catch (FileNotFoundException e) {
  
          e.printStackTrace();
      } catch (IOException e) {
  
      } catch (InterruptedException e) {
  
      } catch (Exception e) {
  
      }catch (OutOfMemoryError e) {
          //update the DB 
      }
  </code></pre>