java获取本地系统变量 Properties 及 RunTime

Properties props = System.getProperties();
		Runtime runtime = Runtime.getRuntime();
		long freeMemoery = runtime.freeMemory();
		long totalMemory = runtime.totalMemory();
		long usedMemory = totalMemory - freeMemoery;
		long maxMemory = runtime.maxMemory();
		long useableMemory = maxMemory - totalMemory + freeMemoery;


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>jeecms-left</title>
<#include "/jeecms_sys/head.html"/>
</head>
<body>
  	    <div class="box-positon">
        	 <h1><@s.m "global.position"/>: <@s.m "global.admin.home"/> - <@s.m "global.admin.index"/></h1>
        </div>
<div class="body-box">
        <div class="welcom-con">
        	 <div class="we-txt">
             	  <p>
                  欢迎使用JEECMS内容管理系统!<br />
                  JEECMS程序版本: jeecmsv5.0 【<a href="http://www.jeecms.com" target="_blank">查看最新版本</a>】<br />
                  您上次登录的时间是:${user.lastLoginTime?string('yyyy-MM-dd')}<br />
                  已用内存:<span style="color:#0078ff;">${(usedMemory/1024/1024)?string("0.##")}MB</span>    剩余内存:<span style="color:#ff8400;">${(useableMemory/1024/1024)?string("0.##")}MB </span>    最大内存:<span style="color:#00ac41;">${(maxMemory/1024/1024)?string("0.##")}MB</span>
                  </p>
             </div>
             <ul class="ms">
             	<li class="wxx">访问量</li><li class="attribute">   系统属性</li>
             </ul>
             <div class="ms-xx">
                 <div class="xx-xx">
             	      <table width="100%" border="0" cellspacing="0" cellpadding="0">
             	       <tr>
                        <td width="20%" height="30" align="right"></td>
                        <td width="25%"><b>PV</b></td>
                        <td width="25%"><b>IP</b></td>
                        <td width="30%"><b>独立访客</b></td>
                    </tr>
                      <tr>
                        <td height="30" align="right">今日:</td>
                        <#list flowMap['today'] as f>
                     	<td>${f.count}</td>
                     	</#list>
                    </tr>
                      <tr>
                        <td height="30" align="right">昨日:</td>
                        <#list flowMap['yesterday'] as f>
                     	<td>${f.count}</td>
                     	</#list>
                    </tr>
                      <tr>
                        <td height="30" align="right">本周:</td>
                        <#list flowMap['thisweek'] as f>
                     	<td>${f.count}</td>
                     	</#list>
                    </tr>
                      <tr>
                        <td height="30" align="right">本月:</td>
                        <#list flowMap['thismonth'] as f>
                     	<td>${f.count}</td>
                     	</#list>
                     </tr>
                     <tr>
                        <td height="30" align="right">累计:</td>
                        <#list flowMap['total'] as f>
                     	<td>${f.count}</td>
                     	</#list>
                     </tr>
               </table>
                 </div>
                 <div class="attribute-xx" style="float:left">
                 	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="30%" height="30" align="right">操作系统版本:</td>
                            <td height="30"><span class="black">${props['os.name']!} ${props['os.version']!}</span></td>
                        </tr>
                          <tr>
                            <td width="30%" height="30" align="right">操作系统类型:</td>
                            <td height="30"><span class="black">${props['os.arch']!} ${props['sun.arch.data.model']!}位</span> </td>
                        </tr>
                          <tr>
                            <td width="30%" height="30" align="right">用户、目录、临时目录:</td>
                            <td height="30"><span class="black">${props['user.name']!}, ${props['user.dir']!}, ${props['java.io.tmpdir']!}</span></td>
                        </tr><tr>
                            <td width="30%" height="30" align="right">JAVA运行环境:</td>
                            <td height="30"><span>${props['java.runtime.name']!} ${props['java.runtime.version']!}</span></td>
                          </tr>
                          <tr>
                            <td width="30%" height="30" align="right">JAVA虚拟机:</td>
                            <td height="30"> <span>${props['java.vm.name']!} ${props['java.vm.version']!}</span></td>
                        </tr>
                   </table>  
               </div>

             </div>
             
  </div>
</body>
</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值