db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r674632 - /db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
Date Mon, 07 Jul 2008 20:49:43 GMT
Author: kmarsden
Date: Mon Jul  7 13:49:43 2008
New Revision: 674632

URL: http://svn.apache.org/viewvc?rev=674632&view=rev
Log:
DERBY-3731 Improve calculation of refSize in ClassSize.java


Modified:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java?rev=674632&r1=674631&r2=674632&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
Mon Jul  7 13:49:43 2008
@@ -71,8 +71,12 @@
 
         // Figure out whether this is a 32 or 64 bit machine.
         Runtime runtime = Runtime.getRuntime();
+        runtime.gc();
+        runtime.runFinalization();
         long memBase = runtime.totalMemory() - runtime.freeMemory();
         Object[] junk = new Object[10000];
+        runtime.gc();
+        runtime.runFinalization();
         long memUsed = runtime.totalMemory() - runtime.freeMemory() - memBase;
         int sz = (int)((memUsed + junk.length/2)/junk.length);
         refSize = ( 4 > sz) ? 4 : sz;



Mime
View raw message