VM Maker: VMMaker.oscog-cb.2419.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-cb.2419.mcz

commits-2
 
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2419.mcz

==================== Summary ====================

Name: VMMaker.oscog-cb.2419
Author: cb
Time: 3 July 2018, 11:01:23.189761 am
UUID: 7d60e922-f6a4-4659-9f35-87fcec6a3b93
Ancestors: VMMaker.oscog-topa.2418

Added stats for Marking time and sweep time in full GC. Make them available as vm parameters 72 and 73.

Now we have:
fullGCTime = markingTime + scavengeTime + compactionTime
With all but scavenge time available, but can be computed in-image from the 3 others.

We note that compactionTime includes sweepTime for convenience. Depending on the compactor used, we have:
Planning -> sweepTime = 0.
Sweeper -> sweepTime = compactionTime.
Selective -> selectiveCompactionTime = compactionTime - sweepTime

=============== Diff against VMMaker.oscog-topa.2418 ===============

Item was added:
+ ----- Method: ObjectMemory>>statMarkUsecs (in category 'accessing') -----
+ statMarkUsecs
+ ^ 0!

Item was added:
+ ----- Method: ObjectMemory>>statSweepUsecs (in category 'accessing') -----
+ statSweepUsecs
+ ^ 0!

Item was changed:
  CogClass subclass: #SpurMemoryManager
(excessive size, no diff calculated)

Item was changed:
  ----- Method: SpurMemoryManager>>fullGC (in category 'gc - global') -----
  fullGC
  "Perform a full lazy compacting GC.  Answer the size of the largest free chunk."
  <returnTypeC: #usqLong>
  <inline: #never> "for profiling"
  needGCFlag := false.
  gcStartUsecs := coInterpreter ioUTCMicrosecondsNow.
  statMarkCount := 0.
  coInterpreter preGCAction: GCModeFull.
  self globalGarbageCollect.
  coInterpreter postGCAction: GCModeFull.
- statFullGCs := statFullGCs + 1.
  statGCEndUsecs := coInterpreter ioUTCMicrosecondsNow.
+ self updateFullGCStats.
- statFullGCUsecs := statFullGCUsecs + (statGCEndUsecs - gcStartUsecs).
- statCompactionUsecs := statCompactionUsecs + (statGCEndUsecs - compactionStartUsecs).
  ^(freeLists at: 0) ~= 0
  ifTrue: [self bytesInObject: self findLargestFreeChunk]
  ifFalse: [0]!

Item was changed:
  ----- Method: SpurMemoryManager>>globalGarbageCollect (in category 'gc - global') -----
  globalGarbageCollect
  <inline: true> "inline into fullGC"
  self assert: self validObjStacks.
  self assert: (self isEmptyObjStack: markStack).
  self assert: (self isEmptyObjStack: weaklingStack).
 
  "Mark objects /before/ scavenging, to empty the rememberedTable of unmarked roots."
  self markObjects: true.
+ gcMarkEndUsecs := coInterpreter ioUTCMicrosecondsNow.
+
-
  scavenger forgetUnmarkedRememberedObjects.
  self doScavenge: MarkOnTenure.
 
  "Mid-way the leak check must be more lenient.  Unmarked classes will have been
  expunged from the table, but unmarked instances will not yet have been reclaimed."
  self runLeakCheckerFor: GCModeFull
  excludeUnmarkedObjs: true
  classIndicesShouldBeValid: true.
 
  compactionStartUsecs := coInterpreter ioUTCMicrosecondsNow.
  segmentManager prepareForGlobalSweep. "for notePinned:"
  compactor compact.
  self attemptToShrink.
  self setHeapSizeAtPreviousGC.
 
  self assert: self validObjStacks.
  self assert: (self isEmptyObjStack: markStack).
  self assert: (self isEmptyObjStack: weaklingStack).
  self assert: self allObjectsUnmarked.
  self runLeakCheckerFor: GCModeFull!

Item was changed:
  ----- Method: SpurMemoryManager>>initialize (in category 'initialization') -----
  initialize
  "We can put all initializations that set something to 0 or to false here.
  In C all global variables are initialized to 0, and 0 is false."
  remapBuffer := Array new: RemapBufferSize.
  remapBufferCount := extraRootCount := 0. "see below"
  freeListsMask := totalFreeOldSpace := lowSpaceThreshold := 0.
  checkForLeaks := 0.
  needGCFlag := signalLowSpace := marking := false.
  becomeEffectsFlags := gcPhaseInProgress := 0.
  statScavenges := statIncrGCs := statFullGCs := 0.
+ statMarkUsecs := statSweepUsecs := statScavengeGCUsecs := statIncrGCUsecs := statFullGCUsecs := statCompactionUsecs := statGCEndUsecs := gcSweepEndUsecs := 0.
- statScavengeGCUsecs := statIncrGCUsecs := statFullGCUsecs := statCompactionUsecs := statGCEndUsecs := 0.
  statSGCDeltaUsecs := statIGCDeltaUsecs := statFGCDeltaUsecs := 0.
  statGrowMemory := statShrinkMemory := statRootTableCount := statAllocatedBytes := 0.
  statRootTableOverflows := statMarkCount := statCompactPassCount := statCoalesces := 0.
 
  "We can initialize things that are allocated but are lazily initialized."
  unscannedEphemerons := SpurContiguousObjStack new.
 
  "we can initialize things that are virtual in C."
  scavenger := SpurGenerationScavenger simulatorClass new manager: self; yourself.
  segmentManager := SpurSegmentManager simulatorClass new manager: self; yourself.
  compactor := self class compactorClass simulatorClass new manager: self; yourself.
 
  "We can also initialize here anything that is only for simulation."
  heapMap := CogCheck32BitHeapMap new.
 
  "N.B. We *don't* initialize extraRoots because we don't simulate it."
  maxOldSpaceSize := self class initializationOptions
  ifNotNil: [:initOpts| initOpts at: #maxOldSpaceSize ifAbsent: [0]]
  ifNil: [0]!

Item was added:
+ ----- Method: SpurMemoryManager>>statMarkUsecs (in category 'accessing') -----
+ statMarkUsecs
+ ^statMarkUsecs!

Item was added:
+ ----- Method: SpurMemoryManager>>statSweepUsecs (in category 'accessing') -----
+ statSweepUsecs
+ ^statSweepUsecs!

Item was added:
+ ----- Method: SpurMemoryManager>>updateFullGCStats (in category 'gc - global') -----
+ updateFullGCStats
+ "Stats updated (since VM start-up):
+ 1) number of full GCs,
+ 2) time spent in full GC,
+ 3) time spent in compaction (included in 2)
+ 4) time spent in sweep phase (included in 2 & 3, 0 if no sweep phase)
+ 5) time spent in mark phase (included in 2)"
+ statFullGCs := statFullGCs + 1.
+ statFullGCUsecs := statFullGCUsecs + (statGCEndUsecs - gcStartUsecs).
+ statCompactionUsecs := statCompactionUsecs + (statGCEndUsecs - compactionStartUsecs).
+ gcSweepEndUsecs = 0 ifFalse: [statSweepUsecs := statSweepUsecs + (gcSweepEndUsecs - compactionStartUsecs)].
+ statMarkUsecs := statMarkUsecs + (gcMarkEndUsecs - gcStartUsecs).!

Item was added:
+ ----- Method: SpurMemoryManager>>updateSweepEndUsecs (in category 'accessing') -----
+ updateSweepEndUsecs
+ gcSweepEndUsecs := coInterpreter ioUTCMicrosecondsNow.!

Item was changed:
  ----- Method: SpurSelectiveCompactor>>compact (in category 'api') -----
  compact
  <inline: #never> "for profiling, though we profile selectiveCompaction and sweep separatly."
  self resetFreeLists.
  self freePastSegmentsAndSetSegmentToFill.
  self globalSweepAndSegmentOccupationAnalysis.
+ manager updateSweepEndUsecs.
  self selectiveCompaction.
  !

Item was changed:
  ----- Method: SpurSweeper>>compact (in category 'api') -----
  compact
  <inline: #never> "for profiling"
  self resetFreeLists.
+ self globalSweep.
+ manager updateSweepEndUsecs!
- self globalSweep!

Item was changed:
  ----- Method: StackInterpreterPrimitives>>primitiveVMParameter (in category 'system control primitives') -----
(excessive size, no diff calculated)