Search in sources :

Example 76 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testCmsMemory.

@Test
public void testCmsMemory() throws Exception {
    String fileName = "SampleSun1_6_0CMS.txt";
    InputStream in = getInputStream(fileName);
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile(fileName), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 41, model.size());
    assertEquals("heap min allocated", 249088, model.getHeapAllocatedSizes().getMin());
    assertEquals("heap max allocated", 249088, model.getHeapAllocatedSizes().getMax());
    assertEquals("young min allocated", 118016, model.getYoungAllocatedSizes().getMin());
    assertEquals("young max allocated", 118016, model.getYoungAllocatedSizes().getMax());
    assertEquals("tenured min allocated", 131072, model.getTenuredAllocatedSizes().getMin());
    assertEquals("tenured max allocated", 131072, model.getTenuredAllocatedSizes().getMax());
    assertEquals("perm min allocated", 21248, model.getPermAllocatedSizes().getMin());
    assertEquals("perm max allocated", 21248, model.getPermAllocatedSizes().getMax());
    assertEquals("heap min used", 80841, model.getHeapUsedSizes().getMin());
    assertEquals("heap max used", 209896, model.getHeapUsedSizes().getMax());
    assertEquals("young min used", 15160, model.getYoungUsedSizes().getMin());
    assertEquals("young max used", 118010, model.getYoungUsedSizes().getMax());
    assertEquals("tenured min used", 0, model.getTenuredUsedSizes().getMin());
    assertEquals("tenured max used", 115034, model.getTenuredUsedSizes().getMax());
    assertEquals("perm min used", 2560, model.getPermUsedSizes().getMin());
    assertEquals("perm max used", 2561, model.getPermUsedSizes().getMax());
    assertEquals("promotion avg", 16998.3846, model.getPromotion().average(), 0.0001);
    assertEquals("promotion total", 220979, model.getPromotion().getSum());
    assertThat("count tenured heap after full gc", model.getFootprintAfterFullGC().getN(), is(2));
    assertThat("max tenured heap after full gc", model.getFootprintAfterFullGC().getMax(), is(31297));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 77 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testCMSWithoutPrintTimeStampConcurrentModeFailure.

@Test
public void testCMSWithoutPrintTimeStampConcurrentModeFailure() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-04-03T20:36:35.284+0200: [GC [ParNew: 19081K->19081K(19136K), 0.0000205 secs][CMS2012-04-03T20:36:35.285+0200: [CMS-concurrent-abortable-preclean: 0.005/0.150 secs] [Times: user=0.14 sys=0.14, real=0.15 secs]" + "\n (concurrent mode failure): 98182K->3832K(98624K), 0.0195864 secs] 117264K->3832K(117760K), [CMS Perm : 2614K->2613K(21248K)], 0.0199322 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 2, model.size());
    assertEquals("heap", 117760, model.getHeapAllocatedSizes().getMax());
    assertEquals("pause", 0.0199322, model.getFullGCPause().getMax(), 0.00000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 78 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testAdaptiveSizePolicyFullSystemGc.

@Test
public void testAdaptiveSizePolicyFullSystemGc() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-03-21T20:49:09.624+0100: 9.993: [Full GC (System)AdaptiveSizeStart: 10.000 collection: 61" + "\nAdaptiveSizeStop: collection: 61" + "\n[PSYoungGen: 480K->0K(270976K)] [PSOldGen: 89711K->671K(145536K)] 90191K->671K(416512K) [PSPermGen: 2614K->2614K(21248K)], 0.0070749 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 1, model.size());
    assertEquals("Full GC pause", 0.0070749, model.getFullGCPause().getMax(), 0.00000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 79 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testPrintCmsStatisticsConcurrentPreclean.

@Test
public void testPrintCmsStatisticsConcurrentPreclean() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-10-20T18:04:57.850+0200: 1.329: [CMS-concurrent-preclean: 0.002/0.002 secs] (CMS-concurrent-preclean yielded 0 times)" + "\n [Times: user=0.00 sys=0.00, real=0.00 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 1, model.size());
    assertEquals("concurrent time", 0.002, model.getConcurrentEventPauses().values().iterator().next().getMin(), 0.000000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 80 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testPrintCmsStatisticsScavengeBeforeRemark.

/**
     * Tests the combination of -XX:PrintCmsStatistics=2 and -XX:+CMSScavengeBeforeRemark
     */
@Test
public void testPrintCmsStatisticsScavengeBeforeRemark() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-10-26T18:31:09.699+0200: 15.473: [GC[YG occupancy: 8752 K (78656 K)]2012-10-26T18:31:09.699+0200: 15.473: [GC 15.473: [ParNew: 8752K->64K(78656K), 0.0052352 secs] 388874K->388870K(515584K), 0.0052868 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]" + "\n15.478: [Rescan (parallel)  (Survivor:0chunks) Finished young gen rescan work in 1th thread: 0.000 sec" + "\nFinished young gen rescan work in 1th thread: 0.000 sec" + "\nFinished young gen rescan work in 0th thread: 0.000 sec" + "\nFinished remaining root rescan work in 1th thread: 0.000 sec" + "\nFinished remaining root rescan work in 2th thread: 0.000 sec" + "\nFinished remaining root rescan work in 0th thread: 0.000 sec" + "\nFinished dirty card rescan work in 0th thread: 0.001 sec" + "\nFinished dirty card rescan work in 2th thread: 0.001 sec" + "\nFinished dirty card rescan work in 1th thread: 0.001 sec" + "\nFinished young gen rescan work in 3th thread: 0.000 sec" + "\nFinished remaining root rescan work in 3th thread: 0.000 sec" + "\nFinished dirty card rescan work in 3th thread: 0.000 sec" + "\nFinished work stealing in 3th thread: 0.000 sec" + "\nFinished work stealing in 2th thread: 0.000 sec" + "\nFinished work stealing in 0th thread: 0.000 sec" + "\nFinished work stealing in 1th thread: 0.000 sec" + "\n, 0.0006571 secs]15.479: [weak refs processing, 0.0000041 secs]15.479: [class unloading, 0.0001106 secs]15.479: [scrub symbol table, 0.0004465 secs]15.480: [scrub string table, 0.0000168 secs] [1 CMS-remark: 388806K(436928K)] 388870K(515584K), 0.0067111 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 2, model.size());
    GCEvent parNew = (GCEvent) model.get(0);
    GCEvent remarkEvent = (GCEvent) model.get(1);
    assertEquals("GC pause ParNew", 0.0052868, parNew.getPause(), 0.000000001);
    assertEquals("GC pause Remark", 0.0067111 - 0.0052868, remarkEvent.getPause(), 0.000000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Aggregations

GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)186 Test (org.junit.Test)178 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)133 ByteArrayInputStream (java.io.ByteArrayInputStream)118 InputStream (java.io.InputStream)69 GCResource (com.tagtraum.perf.gcviewer.model.GCResource)55 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)21 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)11 File (java.io.File)8 ArrayList (java.util.ArrayList)6 GCViewerGuiController (com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController)2 AbstractGCEvent (com.tagtraum.perf.gcviewer.model.AbstractGCEvent)2 LogRecord (java.util.logging.LogRecord)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Matchers.isEmptyString (org.hamcrest.Matchers.isEmptyString)2 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)1 DataReader (com.tagtraum.perf.gcviewer.imp.DataReader)1 DataReaderFactory (com.tagtraum.perf.gcviewer.imp.DataReaderFactory)1 DoubleData (com.tagtraum.perf.gcviewer.math.DoubleData)1 IntData (com.tagtraum.perf.gcviewer.math.IntData)1