cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1001027 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java
Date Fri, 24 Sep 2010 18:52:23 GMT
Author: aadamchik
Date: Fri Sep 24 18:52:22 2010
New Revision: 1001027

URL: http://svn.apache.org/viewvc?rev=1001027&view=rev
Log:
CAY-1485 Memory information for about dialog

* patch by Andrei Veprev

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1001027&r1=1001026&r2=1001027&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Fri Sep 24 18:52:22 2010
@@ -60,6 +60,13 @@ CAY-1364 SQL server don't support notati
 CAY-1430 Problems with TINYINT type mapping
 
 ----------------------------------
+Release: 3.0.2
+Date: 
+----------------------------------
+
+CAY-1485 Memory information for about dialog
+
+----------------------------------
 Release: 3.0.1
 Date: 
 ----------------------------------

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java?rev=1001027&r1=1001026&r2=1001027&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/AboutDialog.java
Fri Sep 24 18:52:22 2010
@@ -67,21 +67,27 @@ public class AboutDialog extends JFrame 
      */
     static synchronized String getInfoString() {
         if (infoString == null) {
-            
-            double bytes = Runtime.getRuntime().maxMemory();
-            long mBytes = Math.round(bytes / 1024 / 1024);
-            
+
+            double maxMemory = (double) Runtime.getRuntime().maxMemory() / 1024 / 1024;
+            double totalMemory = (double) Runtime.getRuntime().totalMemory() / 1024 / 1024;
+            double freeMemory = (double) Runtime.getRuntime().freeMemory() / 1024 / 1024;
+
             StringBuffer buffer = new StringBuffer();
             buffer.append("<html>");
             buffer.append("<font size='-1' face='Arial,Helvetica'>");
             buffer.append(UIStrings.get("cayenne.modeler.about.info"));
             buffer.append("</font>");
-            
+
             buffer.append("<font size='-2' face='Arial,Helvetica'>");
-            buffer.append("<br>JVM: " + System.getProperty("java.vm.name") + " " +

-                    System.getProperty("java.version"));
-            buffer.append("<br>Max Heap Size: " + mBytes + " MB");
-            
+            buffer.append("<br>JVM: "
+                    + System.getProperty("java.vm.name")
+                    + " "
+                    + System.getProperty("java.version"));
+            buffer.append(String.format(
+                    "<br>Memory: used %.2f MB, max %.2f MB",
+                    totalMemory - freeMemory,
+                    maxMemory));
+
             String version = LocalizedStringsHandler.getString("cayenne.version");
             if (version != null) {
                 buffer.append("<br>Version: ").append(version);



Mime
View raw message