protected final boolean isLowMemory(final boolean[] tryToFree) { final LowMemoryWatcher lm = LowMemoryWatcher.getInstance(); boolean ilm = lm.isLowMemory(); if (ilm && tryToFree != null && tryToFree[0]) { lm.free(); ilm = lm.isLowMemory(); tryToFree[0] = false; } return ilm; }
protected final void freeMemory(final boolean freeCaches) { final LowMemoryWatcher lm = LowMemoryWatcher.getInstance(); lm.free(freeCaches); }
LOGGER.log(Level.FINE, null, ex); if (lmListener.isLowMemory()) { flush();
BinaryAnalyser (final @NonNull ClassIndexImpl.Writer writer, final @NonNull File cacheRoot) { Parameters.notNull("writer", writer); //NOI18N Parameters.notNull("cacheRoot", cacheRoot); //NOI18N this.writer = writer; this.cacheRoot = cacheRoot; this.lmListener = LowMemoryWatcher.getInstance(); this.cfg = Config.getDefault(); }
in.close(); if (lmListener.isLowMemory()) { flush();
throw x; if (lmListener.isLowMemory()) { flush();
@Override @NonNull protected boolean executeImpl() throws IOException { while (todo.hasMoreElements()) { FileObject fo = todo.nextElement(); if (accepts(fo.getNameExt())) { final String rp = FileObjects.stripExtension(FileUtil.getRelativePath(root, fo)); report( ElementHandleAccessor.getInstance().create(ElementKind.OTHER, FileObjects.convertFolder2Package(rp)), 0L); final InputStream in = new BufferedInputStream (fo.getInputStream()); try { analyse (in); } catch (InvalidClassFormatException icf) { LOGGER.log(Level.WARNING, "Invalid class file format: {0}", FileUtil.getFileDisplayName(fo)); //NOI18N } finally { in.close(); } if (lmListener.isLowMemory()) { flush(); } } if (isCancelled()) { return false; } } return true; } }