java.lang.OutOfMemoryError.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中java.lang.OutOfMemoryError.getLocalizedMessage()方法的一些代码示例,展示了OutOfMemoryError.getLocalizedMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OutOfMemoryError.getLocalizedMessage()方法的具体详情如下:
包路径:java.lang.OutOfMemoryError
类名称:OutOfMemoryError
方法名:getLocalizedMessage

OutOfMemoryError.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: org.biojava.thirdparty/forester

final static void outOfMemoryError( final OutOfMemoryError e ) {
  System.err.println();
  System.err.println( "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option" );
  System.err.println();
  e.printStackTrace();
  System.err.println();
  JOptionPane.showMessageDialog( null,
                  "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option"
                      + "\n\nError: " + e.getLocalizedMessage(),
                      "Out of Memory Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
                      JOptionPane.ERROR_MESSAGE );
  System.exit( -1 );
}

代码示例来源:origin: yuger/VPN_2017

throw new ConfigParseError("File too large to parse: " + memoryError.getLocalizedMessage());

代码示例来源:origin: gigabytedevelopers/FireFiles

errorMsg = e.getLocalizedMessage();

代码示例来源:origin: dividiti/crowdsource-video-experiments-on-android

@Override
  public void onPictureTaken(byte[] data, Camera camera) {
    try {
      createDirIfNotExist(externalSDCardOpenscienceTmpPath);
      String takenPictureFilPath = String.format(externalSDCardOpenscienceTmpPath + File.separator + "%d.jpg", System.currentTimeMillis());
      FileOutputStream fos = new FileOutputStream(takenPictureFilPath);
      fos.write(data);
      fos.close();
      stopCameraPreview();
      rotateImageAccoridingToOrientation(takenPictureFilPath);
      AppConfigService.updateActualImagePath(takenPictureFilPath);
      if (isPredictionRequired) {
        predictImage(takenPictureFilPath);
      }
    } catch (Exception e) {
      e.printStackTrace();
      AppLogger.logMessage("Error on image capture " + e.getLocalizedMessage());
    } catch (OutOfMemoryError e) {
      e.printStackTrace();
      AppLogger.logMessage("Error on image capture " + e.getLocalizedMessage());
    }
  }
});

代码示例来源:origin: gigabytedevelopers/FireFiles

@Override
  protected void onPostExecute(StringBuilder result) {
    super.onPostExecute(result);
    if(!Utils.isActivityAlive(NoteActivity.this)) {
      return;
    }
    setProgress(false);
    if(null == result){
      showError(errorMsg);
      return;
    }
    try {
      mOriginal = result.toString();
      result.setLength(0); // clear string builder to reduce memory usage
      mInput.setText(mOriginal);
    } catch (OutOfMemoryError e) {
      showError(e.getLocalizedMessage());
    }
  }
}

代码示例来源:origin: mkulesh/microMathematics

throw new Exception(e.getLocalizedMessage());

代码示例来源:origin: mkulesh/microMathematics

public void write(FormulaListView formulaListView, Bitmap.CompressFormat format) throws Exception
  {
    final LinearLayout f = formulaListView.getList();
    Bitmap bitmap = null;
    try
    {
      bitmap = Bitmap.createBitmap(f.getMeasuredWidth(), f.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
      final Canvas canvas = new Canvas(bitmap);
      f.setBackgroundColor(CompatUtils.getThemeColorAttr(f.getContext(), android.R.attr.windowBackground));
      f.draw(canvas);
    }
    catch (OutOfMemoryError e)
    {
      throw new Exception(e.getLocalizedMessage());
    }
    finally
    {
      f.setBackgroundResource(android.R.color.transparent);
    }
    bitmap.compress(format, 100, stream);
    stream.flush();
  }
}

代码示例来源:origin: dividiti/crowdsource-video-experiments-on-android

AppLogger.logMessage("Error on image capture " + e.getLocalizedMessage());
} catch (FileNotFoundException e) {
  AppLogger.logMessage("Error on image capture " + e.getLocalizedMessage());

代码示例来源:origin: matrix-org/matrix-android-sdk

defaultError.error = outOfMemoryError.getLocalizedMessage();
} catch (Exception e) {
  Log.e(LOG_TAG, "doInBackground fail to read image " + e.getMessage(), e);

代码示例来源:origin: org.fudaa.soft.fudaa-mascaret/mascaret-server

throw new RuntimeException("Erreur de calcul, Pas assez de mmoire vive\n" + er.getLocalizedMessage());

相关文章