查看Tomcat内存使用情况的JSP代码

cwf8的头像 cwf8 47 2015-01-11 19:46 0

 基本信息

× 1   

浏览数: 5107

分享时间: 4 年 前

2
    <%  
        double total = (Runtime.getRuntime().totalMemory()) / (1024.0 * 1024);  
        double max = (Runtime.getRuntime().maxMemory()) / (1024.0 * 1024);  
        double free = (Runtime.getRuntime().freeMemory()) / (1024.0 * 1024);  
        out.println("Java 虚拟机试图使用的最大内存量(当前JVM的最大可用内存)maxMemory(): " + max + "MB<br/>");  
        out.println("Java 虚拟机中的内存总量(当前JVM占用的内存总数)totalMemory(): " + total + "MB<br/>");  
        out.println("Java 虚拟机中的空闲内存量(当前JVM空闲内存)freeMemory(): " + free + "MB<br/>");  
        out.println("因为JVM只有在需要内存时才占用物理内存使用,所以freeMemory()的值一般情况下都很小,<br/>" +  
        "而JVM实际可用内存并不等于freeMemory(),而应该等于 maxMemory()-totalMemory()+freeMemory()。<br/>");  
        out.println("JVM实际可用内存: " + (max - total + free) + "MB<br/>");  
    %>  


12 3 [下一页]

  • ossaa的头像 ossaa 2018-06-22 13:34 代码数:0

    You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!

    hydroxycut benefits

  • pevahanifo的头像 pevahanifo 2018-08-27 22:45 代码数:0

    An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. Luxury used cars

  • ossaa的头像 ossaa 2018-10-17 17:45 代码数:0

    I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates.

    Enjoy Mexico Villa Rentals in Cabo San Lucas

  • pevahanifo的头像 pevahanifo 2018-08-28 14:05 代码数:0

    Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. best products to dropship

  • ossaa的头像 ossaa 2018-10-20 20:46 代码数:0

    I am very happy to discover your post as it will become on top in my collection of favorite blogs to visit.

    The Hyde showflat

  • ossaa的头像 ossaa 2018-06-24 16:46 代码数:0

    This is the type of information I’ve long been trying to find. Thank you for writing this information.

    Lebensversicherung Widerrufen

  • cwf8的头像 cwf8 2015-01-11 20:11 代码数:47
    这个不错推荐给大家。
  • ossaa的头像 ossaa 2018-06-25 19:56 代码数:0

    I admire this article for the well-researched content and excellent wording.  I got so involved in this material that I couldn’t stop reading.  I am impressed with your work and skill.  Thank you so much.

    www.stimulhosting.com

  • ossaa的头像 ossaa 2018-06-26 22:02 代码数:0

    Thanks for sharing this quality information with us. I really enjoyed reading. Will surely going to share this URL with my friends.facebook

  • ossaa的头像 ossaa 2018-09-01 18:55 代码数:0

    I was looking at some of your posts on this website and I conceive this web site is really instructive! Keep putting up..  leiloes de imoveis judiciais

您的评论: