db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r673892 - /db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
Date Fri, 04 Jul 2008 01:27:00 GMT
Author: kmarsden
Date: Thu Jul  3 18:27:00 2008
New Revision: 673892

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

port revision 670017 from trunk


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

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java?rev=673892&r1=673891&r2=673892&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
(original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/iapi/services/cache/ClassSize.java
Thu Jul  3 18:27:00 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