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

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

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

OutOfMemoryError.toString介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private void addToCache( Object[] value ) throws KettleException {
 try {
  data.look.add( value );
 } catch ( java.lang.OutOfMemoryError o ) {
  // exception out of memory
  throw new KettleException( BaseMessages.getString( PKG, "FuzzyMatch.Error.JavaHeap", o.toString() ) );
 }
}

代码示例来源:origin: facebook/stetho

private GetResponseBodyResponse readResponseBody(String requestId)
  throws IOException, JsonRpcException {
 GetResponseBodyResponse response = new GetResponseBodyResponse();
 ResponseBodyData bodyData;
 try {
  bodyData = mResponseBodyFileManager.readFile(requestId);
 } catch (OutOfMemoryError e) {
  throw new JsonRpcException(new JsonRpcError(JsonRpcError.ErrorCode.INTERNAL_ERROR,
    e.toString(),
    null /* data */));
 }
 response.body = bodyData.data;
 response.base64Encoded = bodyData.base64Encoded;
 return response;
}

代码示例来源:origin: cSploit/android

Logger.error(ome.toString());

代码示例来源:origin: bradand/XMouse

Toast.makeText(mCont, om.toString(), Toast.LENGTH_LONG).show();
  return null;
} catch(Exception ex){

代码示例来源:origin: posm/OpenMapKitAndroid

/**
 * Draw a 'loading' placeholder with a canvas.
 */
private SafePaint getLoadingTilePaint() {
  if (mLoadingTilePaint == null && mLoadingBackgroundColor != Color.TRANSPARENT) {
    try {
      final int tileSize =
          mTileProvider.getTileSource() != null ? mTileProvider.getTileSource()
              .getTileSizePixels() : 256;
      mLoadingTileBitmap =
          Bitmap.createBitmap(tileSize, tileSize, Bitmap.Config.ARGB_8888);
      final Canvas canvas = new Canvas(mLoadingTileBitmap);
      canvas.drawColor(mLoadingBackgroundColor);
      final int lineSize = tileSize / 16;
      for (int a = 0; a < tileSize; a += lineSize) {
        canvas.drawLine(0, a, tileSize, a, mLoadingPaint);
        canvas.drawLine(a, 0, a, tileSize, mLoadingPaint);
      }
      mLoadingTilePaint = new SafePaint();
      mLoadingTilePaint.setShader(new BitmapShader(mLoadingTileBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT));
    } catch (final OutOfMemoryError e) {
      Log.e(TAG, "OutOfMemoryError getting loading tile: " + e.toString());
      System.gc();
    }
  }
  return mLoadingTilePaint;
}

代码示例来源:origin: baratine/baratine

log.log(Level.WARNING, e.toString(), e);
} catch (Throwable e) {
 e.printStackTrace();

代码示例来源:origin: QDqiaodong/Reader

private MuPDFCore openFile(String path) {
  LogUtils.d(TAG, "openFile: path=" + path);
  int lastSlashPos = path.lastIndexOf('/');
  mFileName = new String(lastSlashPos == -1
      ? path
      : path.substring(lastSlashPos + 1));
  Constants.FILE_NAME = mFileName;
  Constants.DOCUMENT_PATH = path;
  try {
    core = new MuPDFCore(mContext, path);
    Constants.DOC_PAGE_COUNT = core.countPages();
    OutlineActivityData.set(null);
  } catch (Exception e) {
    LogUtils.d(TAG, "open file e.toString=" + e.toString());
    return null;
  } catch (OutOfMemoryError e) {
    //  out of memory is not an Exception, so we catch it separately.
    LogUtils.d(TAG, "e.toString=" + e.toString());
    return null;
  }
  return core;
}

代码示例来源:origin: gncloud/fastcatsearch

hasOutOfMemory = true;
logger.error("PK writing OOM! size = "+keySize+" msg = "+e.getMessage(),e);
throw new IOException(e.toString());

代码示例来源:origin: misakuo/Dream-Catcher

private GetResponseBodyResponse readResponseBody(String requestId)
  throws IOException, JsonRpcException {
 GetResponseBodyResponse response = new GetResponseBodyResponse();
 ResponseBodyData bodyData;
 try {
  bodyData = mResponseBodyFileManager.readFile(requestId);
 } catch (OutOfMemoryError e) {
  throw new JsonRpcException(new JsonRpcError(JsonRpcError.ErrorCode.INTERNAL_ERROR,
    e.toString(),
    null /* data */));
 }
 response.body = bodyData.data;
 response.base64Encoded = bodyData.base64Encoded;
 return response;
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

"Attempting to continue; buffers will be allocated in on-heap memory which can degrade performance. " +
          "Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.",
          MACRO_CHUNK_SIZE, sizeInBytes(), oom.toString());
return false;

代码示例来源:origin: antlr/antlrworks

protected void generateGrammar() {
  String errorMessage = null;
  try {
    if(!codeGenerator.generate())
      errorMessage = codeGenerator.getLastError();
  } catch (Exception e) {
    debuggerTab.getConsole().println(e);
    errorMessage = e.toString();
  } catch (OutOfMemoryError e) {
    debuggerTab.getConsole().println(e);
    errorMessage = e.toString();
  }
  if(errorMessage != null) {
    reportError("Error while generating the grammar:\n"+errorMessage);
  }
}

代码示例来源:origin: ccj659/JJEvent

return null;
} catch (OutOfMemoryError e){
  VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
  remove(key);
  return null;

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

"Attempting to continue; buffers will be allocated in on-heap memory which can degrade performance. " +
          "Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.",
          MACRO_CHUNK_SIZE, sizeInBytes(), oom.toString());
return false;

代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-mobile-splash

log.error("Fatal error during initialization: {}", e.toString()); // FIXME ii8n
log.error("", e);
view.notifyFatalError(notificationWithFeedback().withCaption("Fatal error")

代码示例来源:origin: org.jacorb/jacorb

throw new NO_MEMORY(e.toString());

代码示例来源:origin: jsevellec/cassandra-unit

FBUtilities.prettyPrintMemory(MACRO_CHUNK_SIZE),
          FBUtilities.prettyPrintMemory(sizeInBytes()),
          oom.toString());
return false;

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

FBUtilities.prettyPrintMemory(MACRO_CHUNK_SIZE),
          FBUtilities.prettyPrintMemory(sizeInBytes()),
          oom.toString());
return false;

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

Log.warn(e.toString());
Log.debug(e);
buffer = new NIOBuffer((int) length, NIOBuffer.INDIRECT);

代码示例来源:origin: org.terracotta.ehcachedx.org.mortbay/jetty-patched

@Override
  protected void fill(Content content) throws IOException {
    Buffer buffer = null;
    Resource resource = content.getResource();
    long length = resource.length();
    if (_useFileMappedBuffer && resource.getFile() != null) {
      buffer = new DirectNIOBuffer(resource.getFile());
    } else {
      InputStream is = resource.getInputStream();
      try {
        Connector connector = HttpConnection.getCurrentConnection()
            .getConnector();
        buffer = ((NIOConnector) connector).getUseDirectBuffers() ? (NIOBuffer) new DirectNIOBuffer(
            (int) length)
            : (NIOBuffer) new IndirectNIOBuffer((int) length);
      } catch (OutOfMemoryError e) {
        Log.warn(e.toString());
        Log.debug(e);
        buffer = new IndirectNIOBuffer((int) length);
      }
      buffer.readFrom(is, (int) length);
      is.close();
    }
    content.setBuffer(buffer);
  }
}

代码示例来源:origin: org.gosu-lang.gosu.managed/gw-jetty

Log.warn(e.toString());
Log.debug(e);
buffer = new IndirectNIOBuffer((int) length);

相关文章