Commit 81f1bc1d7d01558f617f0181827c07c811dac9e0
Add gc stat counter in the gc statistics
| |   |
| 23 | 23 | import org.jnode.vm.VmSystem; |
| 24 | 24 | import org.jnode.vm.memmgr.GCStatistics; |
| 25 | 25 | |
| /** |
| * |
| * @author loic |
| * |
| */ |
| 26 | 31 | final class GenGCStatCounter extends GCStatistics { |
| 27 | 32 | |
| 28 | 33 | private String title; |
| |   |
| 35 | 35 | long lastVerifyDuration; |
| 36 | 36 | long lastFreedBytes; |
| 37 | 37 | long lastMarkedObjects; |
| private GenGCStatCounter majorCounter = new GenGCStatCounter("major gc"); |
| private GenGCStatCounter minorCounter = new GenGCStatCounter("minor gc"); |
| private GenGCStatCounter sweepCounter = new GenGCStatCounter("sweep & cleanup"); |
| 38 | 41 | |
| 39 | 42 | public String toString() { |
| 40 | 43 | return "lastGCTime " + lastGCTime + "\n" + "lastMarkIterations " |
| … | … | |
| 45 | 45 | + "lastSweepDuration " + lastSweepDuration + "\n" + "lastCleanupDuration " |
| 46 | 46 | + lastCleanupDuration + "\n" + "lastVerifyDuration " + lastVerifyDuration + "\n" |
| 47 | 47 | + "lastMarkedObjects " + lastMarkedObjects + "\n" + "lastFreedBytes " |
| + lastFreedBytes; |
| + lastFreedBytes + "\n" + majorCounter + minorCounter + sweepCounter; |
| } |
| |
| public void addMajorDuration(long duration) { |
| majorCounter.addExecutionDuration(duration); |
| } |
| |
| public void addMinorDuration(long duration) { |
| minorCounter.addExecutionDuration(duration); |
| } |
| |
| public void addSweepDuration(long duration) { |
| sweepCounter.addExecutionDuration(duration); |
| 49 | 61 | } |
| 50 | 62 | |
| 51 | 63 | } |