亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? cmsmemorymonitor.java

?? cms是開(kāi)源的框架
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
            CmsLog.INIT.info(Messages.get().getBundle().key(
                Messages.LOG_MM_INTERVAL_MAX_USAGE_1,
                new Integer(m_intervalWarning / 1000)));

            if ((m_configuration.getEmailReceiver() == null) || (m_configuration.getEmailSender() == null)) {
                CmsLog.INIT.info(Messages.get().getBundle().key(Messages.LOG_MM_EMAIL_DISABLED_0));
            } else {
                CmsLog.INIT.info(Messages.get().getBundle().key(
                    Messages.LOG_MM_EMAIL_SENDER_1,
                    m_configuration.getEmailSender()));
                Iterator i = m_configuration.getEmailReceiver().iterator();
                int n = 0;
                while (i.hasNext()) {
                    CmsLog.INIT.info(Messages.get().getBundle().key(
                        Messages.LOG_MM_EMAIL_RECEIVER_2,
                        new Integer(n + 1),
                        i.next()));
                    n++;
                }
            }
        }

        if (LOG.isDebugEnabled()) {
            // this will happen only once during system startup

            LOG.debug(Messages.get().getBundle().key(Messages.LOG_MM_CREATED_1, new Date(System.currentTimeMillis())));
        }

    }

    /**
     * @see org.opencms.scheduler.I_CmsScheduledJob#launch(CmsObject, Map)
     */
    public String launch(CmsObject cms, Map parameters) throws Exception {

        CmsMemoryMonitor monitor = OpenCms.getMemoryMonitor();

        // make sure job is not launched twice
        if (m_currentlyRunning) {
            return null;
        }

        try {
            m_currentlyRunning = true;

            // update the memory status
            monitor.updateStatus();

            // check if the system is in a low memory condition
            if (monitor.lowMemory()) {
                // log warning
                monitor.monitorWriteLog(true);
                // send warning email
                monitor.monitorSendEmail(true);
                // clean up caches     
                monitor.clearCaches();
            }

            // check if regular a log entry must be written
            if ((System.currentTimeMillis() - monitor.m_lastLogStatus) > monitor.m_intervalLog) {
                monitor.monitorWriteLog(false);
            }

            // check if the memory status email must be send
            if ((System.currentTimeMillis() - monitor.m_lastEmailStatus) > monitor.m_intervalEmail) {
                monitor.monitorSendEmail(false);
            }
        } finally {
            // make sure state is reset even if an error occurs, 
            // otherwise MM will not be executed after an error
            m_currentlyRunning = false;
        }

        return null;
    }

    /**
     * Returns true if the system runs low on memory.<p>
     * 
     * @return true if the system runs low on memory
     */
    public boolean lowMemory() {

        return ((m_maxUsagePercent > 0) && (m_memoryCurrent.getUsage() > m_maxUsagePercent));
    }

    /**
     * Adds a new object to the monitor.<p>
     * 
     * @param objectName name of the object
     * @param object the object for monitoring
     */
    public void register(String objectName, Object object) {

        m_monitoredObjects.put(objectName, object);
    }

    /**
     * Clears the OpenCms caches.<p> 
     */
    private void clearCaches() {

        if ((m_lastClearCache + INTERVAL_CLEAR) > System.currentTimeMillis()) {
            // if the cache has already been cleared less then 15 minutes ago we skip this because 
            // clearing the caches to often will hurt system performance and the 
            // setup seems to be in trouble anyway
            return;
        }
        m_lastClearCache = System.currentTimeMillis();
        if (LOG.isWarnEnabled()) {
            LOG.warn(Messages.get().getBundle().key(Messages.LOG_CLEAR_CACHE_MEM_CONS_0));
        }
        OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, Collections.EMPTY_MAP));
        System.gc();
    }

    /**
     * Returns the cache costs of a monitored object.<p>
     * obj must be of type CmsLruCache 
     * 
     * @param obj the object
     * @return the cache costs or "-"
     */
    private long getCosts(Object obj) {

        long costs = 0;
        if (obj instanceof CmsLruCache) {
            costs = ((CmsLruCache)obj).getObjectCosts();
            if (costs < 0) {
                costs = 0;
            }
        }

        return costs;
    }

    /**
     * Returns the number of items within a monitored object.<p>
     * obj must be of type CmsLruCache, CmsLruHashMap or Map
     * 
     * @param obj the object
     * @return the number of items or "-"
     */
    private String getItems(Object obj) {

        if (obj instanceof CmsLruCache) {
            return Integer.toString(((CmsLruCache)obj).size());
        }
        if (obj instanceof Map) {
            return Integer.toString(((Map)obj).size());
        }
        return "-";
    }

    /**
     * Returns the total size of key strings within a monitored map.<p>
     * the keys must be of type String.
     * 
     * @param map the map
     * @param depth the max recursion depth for calculation the size
     * @return total size of key strings
     */
    private long getKeySize(Map map, int depth) {

        long keySize = 0;
        try {
            Object[] values = map.values().toArray();
            for (int i = 0, s = values.length; i < s; i++) {

                Object obj = values[i];

                if (obj instanceof Map && depth < MAX_DEPTH) {
                    keySize += getKeySize((Map)obj, depth + 1);
                    continue;
                }
            }
            values = null;

            Object[] keys = map.keySet().toArray();
            for (int i = 0, s = keys.length; i < s; i++) {

                Object obj = keys[i];

                if (obj instanceof String) {
                    String st = (String)obj;
                    keySize += (st.length() * 2);
                }
            }
        } catch (ConcurrentModificationException e) {
            // this might happen since even the .toArray() method internally creates an iterator
        } catch (Throwable t) {
            // catch all other exceptions otherwise the whole monitor will stop working
            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_CAUGHT_THROWABLE_1, t.getMessage()));
            }
        }

        return keySize;
    }

    /**
     * Returns the total size of key strings within a monitored object.<p>
     * obj must be of type map, the keys must be of type String.
     * 
     * @param obj the object
     * @return the total size of key strings
     */
    private long getKeySize(Object obj) {

        if (obj instanceof Map) {
            return getKeySize((Map)obj, 1);
        }

        return 0;
    }

    /**
     * Returns the max costs for all items within a monitored object.<p>
     * obj must be of type CmsLruCache, CmsLruHashMap
     * 
     * @param obj the object
     * @return max cost limit or "-"
     */
    private String getLimit(Object obj) {

        if (obj instanceof CmsLruCache) {
            return Integer.toString(((CmsLruCache)obj).getMaxCacheCosts());
        }
        if (obj instanceof LRUMap) {
            return Integer.toString(((LRUMap)obj).maxSize());
        }

        return "-";
    }

    /**
     * Returns the total value size of a list object.<p>
     * 
     * @param listValue the list object
     * @param depth the max recursion depth for calculation the size
     * @return the size of the list object
     */
    private long getValueSize(List listValue, int depth) {

        long totalSize = 0;
        try {
            Object[] values = listValue.toArray();
            for (int i = 0, s = values.length; i < s; i++) {

                Object obj = values[i];

                if (obj instanceof CmsAccessControlList) {
                    obj = ((CmsAccessControlList)obj).getPermissionMap();
                }

                if (obj instanceof CmsFlexCacheVariation) {
                    obj = ((CmsFlexCacheVariation)obj).m_map;
                }

                if (obj instanceof Map && depth < MAX_DEPTH) {
                    totalSize += getValueSize((Map)obj, depth + 1);
                    continue;
                }

                if (obj instanceof List && depth < MAX_DEPTH) {
                    totalSize += getValueSize((List)obj, depth + 1);
                    continue;
                }

                totalSize += getMemorySize(obj);
            }
        } catch (ConcurrentModificationException e) {
            // this might happen since even the .toArray() method internally creates an iterator
        } catch (Throwable t) {
            // catch all other exceptions otherwise the whole monitor will stop working
            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_CAUGHT_THROWABLE_1, t.getMessage()));
            }
        }

        return totalSize;
    }

    /**
     * Returns the total value size of a map object.<p>
     * 
     * @param mapValue the map object
     * @param depth the max recursion depth for calculation the size
     * @return the size of the map object
     */
    private long getValueSize(Map mapValue, int depth) {

        long totalSize = 0;
        try {
            Object[] values = mapValue.values().toArray();
            for (int i = 0, s = values.length; i < s; i++) {

                Object obj = values[i];

                if (obj instanceof CmsAccessControlList) {
                    obj = ((CmsAccessControlList)obj).getPermissionMap();
                }

                if (obj instanceof CmsFlexCacheVariation) {
                    obj = ((CmsFlexCacheVariation)obj).m_map;
                }

                if (obj instanceof Map && depth < MAX_DEPTH) {
                    totalSize += getValueSize((Map)obj, depth + 1);
                    continue;
                }

                if (obj instanceof List && depth < MAX_DEPTH) {
                    totalSize += getValueSize((List)obj, depth + 1);
                    continue;
                }

                totalSize += getMemorySize(obj);
            }
        } catch (ConcurrentModificationException e) {
            // this might happen since even the .toArray() method internally creates an iterator

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩你懂的在线观看| 国产日韩欧美综合在线| 国产精品一二三| 一区二区三区免费观看| 久久伊人蜜桃av一区二区| 欧美日韩精品综合在线| 成人avav影音| 国模大尺度一区二区三区| 午夜精品爽啪视频| 1024成人网色www| 久久久噜噜噜久久人人看 | 国产精品萝li| 日韩你懂的在线播放| 欧美色偷偷大香| av男人天堂一区| 岛国一区二区三区| 国产真实精品久久二三区| 日本伊人午夜精品| 亚洲一区二区三区三| 中文字幕亚洲在| 国产精品久久午夜| 亚洲国产高清在线观看视频| 欧美精品一区二| 精品免费国产一区二区三区四区| 欧美日韩色综合| 在线观看日产精品| 91久久精品国产91性色tv| www.色综合.com| 懂色av一区二区在线播放| 国产一区二区导航在线播放| 青青草国产精品97视觉盛宴| 亚洲成av人片在线| 亚洲国产精品一区二区久久| 一区二区三区中文在线观看| ㊣最新国产の精品bt伙计久久| 久久这里都是精品| 国产免费久久精品| 久久久av毛片精品| 国产欧美一区二区精品性| 久久久久久久综合狠狠综合| 久久综合色之久久综合| 久久久91精品国产一区二区精品| 精品成人a区在线观看| 精品国产精品网麻豆系列| 精品剧情在线观看| 久久久精品tv| 国产精品美女久久久久aⅴ国产馆| 久久久久国产精品厨房| 国产欧美一区二区精品性色超碰| 欧美经典三级视频一区二区三区| 国产精品免费视频一区| 综合分类小说区另类春色亚洲小说欧美| 国产精品乱码人人做人人爱| 亚洲欧美在线另类| 亚洲一区在线电影| 蜜芽一区二区三区| 激情成人午夜视频| 成人美女视频在线观看| 99精品久久99久久久久| 在线观看网站黄不卡| 欧美精品tushy高清| 日韩精品资源二区在线| 中文字幕高清不卡| 亚洲综合色视频| 裸体一区二区三区| 国产成人a级片| 日本高清不卡视频| 91精品国产综合久久精品app | 亚洲卡通欧美制服中文| 性做久久久久久免费观看| 热久久国产精品| 国产成人午夜视频| 色素色在线综合| 欧美va亚洲va香蕉在线| 中文字幕一区二区三区在线观看 | 久久亚洲私人国产精品va媚药| 亚洲国产成人在线| 亚洲国产日韩a在线播放| 蜜桃免费网站一区二区三区| 成人免费毛片高清视频| 精品视频999| 国产偷v国产偷v亚洲高清| 亚洲尤物视频在线| 国产一区视频导航| 91精品91久久久中77777| 精品国精品国产尤物美女| 国产精品高清亚洲| 麻豆精品视频在线| 色久优优欧美色久优优| 欧美mv日韩mv| 亚洲成在人线在线播放| 东方aⅴ免费观看久久av| 欧美色综合影院| 欧美激情在线免费观看| 日本美女一区二区| 色香蕉成人二区免费| 久久久久久综合| 图片区小说区区亚洲影院| 成人精品视频一区二区三区尤物| 3751色影院一区二区三区| 国产精品激情偷乱一区二区∴| 免费的国产精品| 在线免费观看日韩欧美| 欧美国产日本视频| 久久99在线观看| 欧美日韩国产精品成人| 亚洲欧洲制服丝袜| 大白屁股一区二区视频| 精品三级av在线| 五月天一区二区三区| 91精品91久久久中77777| 国产精品美女久久久久久久| 激情深爱一区二区| 欧美精品免费视频| 亚洲中国最大av网站| 91在线精品一区二区三区| 久久蜜臀精品av| 久久精品免费观看| 91精品国产综合久久婷婷香蕉| 一区二区三区欧美日| 92精品国产成人观看免费 | 国产丝袜美腿一区二区三区| 秋霞国产午夜精品免费视频| 欧美亚洲图片小说| 一区二区三区日韩| 欧美中文字幕久久| 伊人开心综合网| 色综合久久中文字幕| 国产精品久久久久久亚洲毛片| 国产激情一区二区三区桃花岛亚洲| 日韩网站在线看片你懂的| 日韩国产精品大片| 欧美精品v国产精品v日韩精品| 亚洲成国产人片在线观看| 欧美日韩视频在线第一区 | 成人黄色大片在线观看| 日本一区二区三级电影在线观看| 国产美女久久久久| 久久精品无码一区二区三区| 国产一区亚洲一区| 久久美女高清视频| 国产精品一区二区视频| 国产日韩三级在线| 成人精品视频一区| 一区二区视频在线| 欧美怡红院视频| 日韩黄色免费网站| 日韩一区二区视频| 狠狠色狠狠色综合| 亚洲国产精品99久久久久久久久 | 成人精品免费视频| 国产精品国产馆在线真实露脸 | 精品久久国产97色综合| 国产资源精品在线观看| 国产拍欧美日韩视频二区| 99综合电影在线视频| 亚洲自拍偷拍麻豆| 51精品视频一区二区三区| 久久草av在线| 国产精品拍天天在线| 色国产综合视频| 麻豆精品一二三| 国产精品久久久久久户外露出 | 精品久久久久99| 成人免费视频一区| 亚洲.国产.中文慕字在线| 精品国产免费一区二区三区香蕉| 国产精品一区一区| 亚洲综合一区二区三区| 日韩一区二区在线看| 成人免费视频免费观看| 天堂资源在线中文精品| 久久久久久久av麻豆果冻| 91福利区一区二区三区| 韩国欧美国产1区| 一色屋精品亚洲香蕉网站| 91精品国产综合久久久久久漫画 | 亚洲一区免费观看| 精品久久久久久久久久久久久久久久久 | 一区二区三区四区视频精品免费| 欧美日韩黄色影视| 国产精品一品二品| 亚洲一区二区精品视频| 久久久亚洲精品石原莉奈| 欧美影视一区二区三区| 国产成人在线电影| 亚洲国产aⅴ天堂久久| 国产日韩欧美在线一区| 制服丝袜av成人在线看| 成人精品鲁一区一区二区| 奇米色777欧美一区二区| 国产精品国产三级国产aⅴ入口 | 一区二区国产盗摄色噜噜| 久久综合九色综合97婷婷女人 | 久久先锋影音av| 欧美三级电影一区| 99久久国产综合精品女不卡| 另类小说色综合网站| 一区二区三区鲁丝不卡| 欧美国产精品专区|