HBASE-6918 Debugging to help figure what is different up on jenkins when TestHeapSize runs

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1392753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-10-02 06:09:49 +00:00
parent af166fca13
commit d6cca23ed3
1 changed files with 18 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.CopyOnWriteArrayList;
@ -49,6 +50,9 @@ import org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.ClassSize;
import org.junit.experimental.categories.Category;
import org.junit.Before;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
/**
* Testing the sizing that HeapSize offers and compares to the size given by
@ -60,6 +64,20 @@ public class TestHeapSize extends TestCase {
// List of classes implementing HeapSize
// BatchOperation, BatchUpdate, BlockIndex, Entry, Entry<K,V>, HStoreKey
// KeyValue, LruBlockCache, LruHashMap<K,V>, Put, HLogKey
@Before
public void setUp() throws Exception {
// Print detail on jvm so we know what is different should below test fail.
RuntimeMXBean b = ManagementFactory.getRuntimeMXBean();
LOG.info("name=" + b.getName());
LOG.info("specname=" + b.getSpecName());
LOG.info("specvendor=" + b.getSpecVendor());
LOG.info("vmname=" + b.getVmName());
LOG.info("vmversion=" + b.getVmVersion());
LOG.info("vmvendor=" + b.getVmVendor());
Map<String, String> p = b.getSystemProperties();
LOG.info("properties=" + p);
}
/**
* Test our hard-coded sizing of native java objects