Commit 81f1bc1d7d01558f617f0181827c07c811dac9e0

  • avatar
  • loic <loic @x37-l…top.(none)>
  • Tue Feb 02 18:02:04 CET 2010
Add gc stat counter in the gc statistics
  
2323import org.jnode.vm.VmSystem;
2424import org.jnode.vm.memmgr.GCStatistics;
2525
26/**
27 *
28 * @author loic
29 *
30 */
2631final class GenGCStatCounter extends GCStatistics {
2732
2833 private String title;
  
3535 long lastVerifyDuration;
3636 long lastFreedBytes;
3737 long lastMarkedObjects;
38 private GenGCStatCounter majorCounter = new GenGCStatCounter("major gc");
39 private GenGCStatCounter minorCounter = new GenGCStatCounter("minor gc");
40 private GenGCStatCounter sweepCounter = new GenGCStatCounter("sweep & cleanup");
3841
3942 public String toString() {
4043 return "lastGCTime " + lastGCTime + "\n" + "lastMarkIterations "
4545 + "lastSweepDuration " + lastSweepDuration + "\n" + "lastCleanupDuration "
4646 + lastCleanupDuration + "\n" + "lastVerifyDuration " + lastVerifyDuration + "\n"
4747 + "lastMarkedObjects " + lastMarkedObjects + "\n" + "lastFreedBytes "
48 + lastFreedBytes;
48 + lastFreedBytes + "\n" + majorCounter + minorCounter + sweepCounter;
49 }
50
51 public void addMajorDuration(long duration) {
52 majorCounter.addExecutionDuration(duration);
53 }
54
55 public void addMinorDuration(long duration) {
56 minorCounter.addExecutionDuration(duration);
57 }
58
59 public void addSweepDuration(long duration) {
60 sweepCounter.addExecutionDuration(duration);
4961 }
5062
5163}