Examples of SunTileCache


Examples of com.lightcrafts.media.jai.util.SunTileCache

    public static TileCache createTileCache(int tileCapacity,
                                            long memCapacity) {
        if (memCapacity < 0) {
            throw new IllegalArgumentException(JaiI18N.getString("JAI10"));
        }
        return new SunTileCache(memCapacity);
    }
View Full Code Here

Examples of com.lightcrafts.media.jai.util.SunTileCache

     */
    public static TileCache createTileCache(long memCapacity) {
        if (memCapacity < 0) {
            throw new IllegalArgumentException(JaiI18N.getString("JAI10"));
        }
        return new SunTileCache(memCapacity);
    }
View Full Code Here

Examples of com.lightcrafts.media.jai.util.SunTileCache

     * belonging to the default<code>JAI</code>instance.  To force an operation
     * not to perform caching, a <code>TileCache</code> instance with
     * a tile capacity of 0 may be used.
     */
    public static TileCache createTileCache() {
        return new SunTileCache();
    }
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

       
        add(new Link("free.memory.jai") {
            private static final long serialVersionUID = 1L;

            public void onClick() {
                SunTileCache 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();
            }
        });

        add(new AjaxLink("clear.resourceCache") {
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

        values.put(KEY_JAI_IMAGEIO_AVAILABLE, Boolean.toString(PackageUtil.isCodecLibAvailable()));

        GeoServerInfo geoServerInfo = getGeoServer().getGlobal();
        JAIInfo jaiInfo = geoServerInfo.getJAI();
        JAI jai =  jaiInfo.getJAI();
        SunTileCache jaiCache = jaiInfo.getTileCache();

        values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity()));
        values.put(KEY_JAI_MEM_USAGE, formatMemory(jaiCache.getCacheMemoryUsed()));
        values.put(KEY_JAI_MEM_THRESHOLD, Float.toString(100.0f * jaiCache.getMemoryThreshold()));
        values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
        values.put(KEY_JAI_TILE_THREAD_PRIORITY, Integer.toString(jai.getTileScheduler()
                .getPriority()));

        values.put(KEY_UPDATE_SEQUENCE, Long.toString(geoServerInfo.getUpdateSequence()));
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

            jaiDef.setRenderingHint(JAI.KEY_TILE_FACTORY, recyclingFactory);
            jaiDef.setRenderingHint(JAI.KEY_TILE_RECYCLER, recyclingFactory);
        }
       
        // Setting up Cache Capacity
        SunTileCache jaiCache = (SunTileCache) jaiDef.getTileCache();
        jai.setTileCache( jaiCache );
       
        long jaiMemory = (long) (jai.getMemoryCapacity() * Runtime.getRuntime().maxMemory());
        jaiCache.setMemoryCapacity(jaiMemory);
       
        // Setting up Cache Threshold
        jaiCache.setMemoryThreshold((float) jai.getMemoryThreshold());
       
        jaiDef.getTileScheduler().setParallelism(jai.getTileThreads());
        jaiDef.getTileScheduler().setPrefetchParallelism(jai.getTileThreads());
        jaiDef.getTileScheduler().setPriority(jai.getTilePriority());
        jaiDef.getTileScheduler().setPrefetchPriority(jai.getTilePriority());
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

        /**
         Initialize Java Advanced Imaging.
         */
        public static void initJAI() {
            JAI jaiInstance = JAI.getDefaultInstance();
            jaiInstance.setTileCache( new SunTileCache( 100*1024*1024 ) );
            jaiInstance.setDefaultTileSize( new Dimension( 256, 256 ) );
        /*
         Not sure how much this helps in practice - Photovault still seems to use
         all heap available in the long run.
         */
 
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

  }
    }
   
    public String getJAICacheDebugInfo() {
        StringBuffer buf = new StringBuffer();
        SunTileCache tileCache = (SunTileCache) JAI.getDefaultInstance().getTileCache();
        buf.append( "cmiss=" + tileCache.getCacheMissCount() + ", chits=" + tileCache.getCacheHitCount() +
                ", ctiles=" + tileCache.getCacheTileCount() + "cache used=" + tileCache.getCacheMemoryUsed() );
        return buf.toString();
    }
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

    public static TileCache createTileCache(int tileCapacity,
                                            long memCapacity) {
        if (memCapacity < 0) {
            throw new IllegalArgumentException(JaiI18N.getString("JAI10"));
        }
        return new SunTileCache(memCapacity);
    }
View Full Code Here

Examples of com.sun.media.jai.util.SunTileCache

     */
    public static TileCache createTileCache(long memCapacity) {
        if (memCapacity < 0) {
            throw new IllegalArgumentException(JaiI18N.getString("JAI10"));
        }
        return new SunTileCache(memCapacity);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.