<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Swing


    天行健 君子以自強不息

    posts - 69, comments - 215, trackbacks - 0, articles - 16
       :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    Java中取JVM中內存的方法

    Posted on 2008-04-18 14:10 zht 閱讀(684) 評論(4)  編輯  收藏 所屬分類: J2SE

      Runtime runtime = Runtime.getRuntime();
      long total = runtime.totalMemory();

      long free = runtime.freeMemory();
      System.out.println(total+"-"+free);


    totalMemory()
        /**
         * Returns the total amount of memory in the Java virtual machine.
         * The value returned by this method may vary over time, depending on
         * the host environment.
         * <p>
         * Note that the amount of memory required to hold an object of any
         * given type may be implementation-dependent.
         *
         * @return  the total amount of memory currently available for current
         *          and future objects, measured in bytes.
         */
    freeMemory()
        /**
         * Returns the amount of free memory in the Java Virtual Machine.
         * Calling the
         * <code>gc</code> method may result in increasing the value returned
         * by <code>freeMemory.</code>
         *
         * @return  an approximation to the total amount of memory currently
         *          available for future allocated objects, measured in bytes.
         */

    通過這個方法,可以寫一個類似于Windows任務管理器的面板:
    主站蜘蛛池模板: 国产精品白浆在线观看免费| 野花视频在线官网免费1| 国产精品免费大片| 亚洲精品无码乱码成人| 国产在线精品一区免费香蕉| 亚洲一区二区三区在线观看精品中文| 男男gvh肉在线观看免费| 国产免费私拍一区二区三区| 粉色视频成年免费人15次| 四虎影视免费永久在线观看| 免费无码婬片aaa直播表情| 亚洲人妻av伦理| 国产午夜精品理论片免费观看| 亚洲熟女少妇一区二区| 成全视频在线观看免费| 中文字幕亚洲免费无线观看日本| 色欲国产麻豆一精品一AV一免费| 亚洲国产高清美女在线观看| 18禁成年无码免费网站无遮挡| 亚洲国产精品无码第一区二区三区| 日日夜夜精品免费视频| 羞羞视频在线观看免费| 国产亚洲一区二区手机在线观看| 99视频免费观看| 亚洲熟女乱色一区二区三区| va亚洲va日韩不卡在线观看| 国产大片免费天天看| 久久久久亚洲AV无码专区首JN| 久久这里只有精品国产免费10| 男男gvh肉在线观看免费| 午夜影视日本亚洲欧洲精品一区| 免费能直接在线观看黄的视频| 久久久久亚洲精品无码网址色欲| 怡红院亚洲怡红院首页| 在线看片v免费观看视频777 | 国产免费观看a大片的网站| 99精品全国免费观看视频..| 亚洲国产成人精品无码区在线秒播| 国产真人无遮挡作爱免费视频| 99re6在线精品免费观看| 亚洲日韩一区二区三区|