public long getMemoryCapacity() { return tileCache.getMemoryCapacity(); }
@PostConstruct protected void initJai() { TileCache cache = JAI.getDefaultInstance().getTileCache(); cache.setMemoryCapacity(getJaiTileCacheInMb() * MB); log.info("JAI cache size set to " + cache.getMemoryCapacity() / MB + " MB"); }
private static synchronized TileCache getTileCache() { if (tileCache == null) { boolean useFileTileCache = Boolean.parseBoolean( System.getProperty(GPF.USE_FILE_TILE_CACHE_PROPERTY, "false")); if (useFileTileCache) { tileCache = new SwappingTileCache(JAI.getDefaultInstance().getTileCache().getMemoryCapacity(), new DefaultSwapSpace(SwappingTileCache.DEFAULT_SWAP_DIR, BeamLogManager.getSystemLogger())); } else { tileCache = JAI.getDefaultInstance().getTileCache(); } BeamLogManager.getSystemLogger().info( String.format("All GPF operators will share an instance of %s with a capacity of %dM", tileCache.getClass().getName(), tileCache.getMemoryCapacity() / (1024 * 1024))); } return tileCache; }
public void onClick() { TileCache jaiCache = getGeoServer().getGlobal().getJAI().getTileCache(); final long capacityBefore = jaiCache.getMemoryCapacity(); jaiCache.flush(); jaiCache.setMemoryCapacity(0); // to be sure we realease all tiles System.gc(); System.runFinalization(); jaiCache.setMemoryCapacity(capacityBefore); updateModel(); } });
TileCache jaiCache = jaiInfo.getTileCache(); values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity())); if(jaiCache instanceof CacheDiagnostics) { values.put(KEY_JAI_MEM_USAGE, formatMemory(((CacheDiagnostics) jaiCache).getCacheMemoryUsed()));
public void onClick() { TileCache jaiCache = parent.getGeoServer().getGlobal().getJAI().getTileCache(); final long capacityBefore = jaiCache.getMemoryCapacity(); jaiCache.flush(); jaiCache.setMemoryCapacity(0); // to be sure we realease all tiles System.gc(); System.runFinalization(); jaiCache.setMemoryCapacity(capacityBefore); updateModel(); } });
sb.append(tileCache.getMemoryCapacity() / (1024 * 1024)); sb.append(" MB\n");
TileCache jaiCache = jaiInfo.getTileCache(); values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity())); if (jaiCache instanceof CacheDiagnostics) { values.put(
sb.append(tileCache.getMemoryCapacity() / (1024 * 1024)); sb.append(" MB\n");
c.gridy++; c.insets.top=12; pane.add(new JLabel(resources.getString(VocabularyKeys.TILE_CACHE_CAPACITY_$1, new Float( JAI.getDefaultInstance().getTileCache().getMemoryCapacity()/HEAP_SIZE_UNIT))), c); c.gridy++; c.insets.top=0; pane.add(totalMemoryLabel, c);
/** * Sets the memory capacity of the default tile cache in megabytes * * @param megabytes the memory capacity in megabytes */ public static void setDefaultTileCacheCapacity(int megabytes) { final TileCache tileCache = JAI.getDefaultInstance().getTileCache(); // JAIJAIJAI tileCache.memoryControl(); tileCache.setMemoryCapacity(megabytes * 1024L * 1024L); Debug.trace("JAI tile cache capacity set to " + tileCache.getMemoryCapacity() + " bytes"); }
rcWebConfig.put("jaiTileCacheMemoryCapacity", JAI.getDefaultInstance().getTileCache().getMemoryCapacity());
float fJaiTileCacheSizeMb = JAI.getDefaultInstance().getTileCache().getMemoryCapacity() / 1024F / 1024F; System.out.println(this.getDisplayName() + ": JAI tile cache size: " + numForm1.format(fJaiTileCacheSizeMb) + "MB");
jsonResponseData.put("jaiTileCacheMemoryCapacity", tileCache.getMemoryCapacity()); if (tileCache instanceof SunTileCache) { jsonResponseData.put("jaiTileCacheMemoryUsed", ((SunTileCache) tileCache).getCacheMemoryUsed());
private void initializeJAI() { long tileCacheCapacity = commandLineArgs.getTileCacheCapacity(); int tileSchedulerParallelism = commandLineArgs.getTileSchedulerParallelism(); if (tileCacheCapacity > 0) { JAI.enableDefaultTileCache(); JAI.getDefaultInstance().getTileCache().setMemoryCapacity(tileCacheCapacity); } else { JAI.getDefaultInstance().getTileCache().setMemoryCapacity(0L); JAI.disableDefaultTileCache(); } if (tileSchedulerParallelism > 0) { JAI.getDefaultInstance().getTileScheduler().setParallelism(tileSchedulerParallelism); } final long tileCacheSize = JAI.getDefaultInstance().getTileCache().getMemoryCapacity() / (1024L * 1024L); commandLineContext.getLogger().info(MessageFormat.format("JAI tile cache size is {0} MB", tileCacheSize)); final int schedulerParallelism = JAI.getDefaultInstance().getTileScheduler().getParallelism(); commandLineContext.getLogger().info( MessageFormat.format("JAI tile scheduler parallelism is {0}", schedulerParallelism)); }
double mpixels = W * H / time / (1000 * 1000); System.out.println(op.getClass().getSimpleName() + ":"); System.out.println(" Cache size: " + JAI.getDefaultInstance().getTileCache().getMemoryCapacity() / M + " M"); System.out.println(" Total time: " + time + " s"); System.out.println(" Throughput: " + mpixels + " mega-pixels/s");