[squeak-dev] The Trunk: Monticello-cmm.552.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 14 18:33:38 UTC 2013


Chris Muller uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-cmm.552.mcz

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

Name: Monticello-cmm.552
Author: cmm
Time: 13 August 2013, 11:13:41.446 am
UUID: 76c39deb-108e-4900-a040-872356170e4c
Ancestors: Monticello-fbs.551

- Introducing MCInfoProxy, a proxy object which loosely refers to a MCVersionInfo residing in its original respository, so that the many thousands of old MCVresionInfo instances can be purged from memory, resulting in a slimmer image.
- The purge is activated via MCWorkingCopy stubOldPackageInfos, or at the same time the user selects "flush cached versions" from the menu (because the goal of the user in selecting that is to slim the image).
- The most recent 10 VersionInfo's for each MCWorkingCopy are kept in memory, allowing diffs from the menu to be activated without needing to re-retrieve from the repository.
- If an operation requiring the full ancestry tree is required, the original VersionInfo is automatically retrieved again from their descendants repository.  This assumes the descendants exist in the same repository as their ancestors.

=============== Diff against Monticello-fbs.551 ===============

Item was changed:
+ ----- Method: MCAncestry>>initialize (in category 'initialize-release') -----
- ----- Method: MCAncestry>>initialize (in category 'initializing') -----
  initialize
  	ancestors := #().
  	stepChildren := #()!

Item was added:
+ ----- Method: MCAncestry>>stubAncestryUsing: (in category 'initialize-release') -----
+ stubAncestryUsing: aMCRepository 
+ 	ancestors := ancestors collect:
+ 		[ : each | MCInfoProxy
+ 			info: each withTrimmedAncestry
+ 			repository: aMCRepository ]!

Item was added:
+ ProtoObject subclass: #MCInfoProxy
+ 	instanceVariableNames: 'info repository'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Monticello-Repositories'!
+ 
+ !MCInfoProxy commentStamp: 'cmm 8/12/2013 21:51' prior: 0!
+ A MCInfoProxy takes the place of a MCVersionInfo with a large tree of ancestors that consume memory in the image, but are almost never accessed.  If they are, however, I will dynamically retrieve and become the Info from the original MC repository which includes the full ancestry tree.!

Item was added:
+ ----- Method: MCInfoProxy class>>info:repository: (in category 'create') -----
+ info: aMCVersionInfo repository: aMCRepository 
+ 	^ self new
+ 		
+ 		setInfo: aMCVersionInfo
+ 		repository: aMCRepository!

Item was added:
+ ----- Method: MCInfoProxy>>becomeAncestry (in category 'private') -----
+ becomeAncestry
+ 	^ self become: (repository versionWithInfo: info) info!

Item was added:
+ ----- Method: MCInfoProxy>>doesNotUnderstand: (in category 'private') -----
+ doesNotUnderstand: aMessage
+ 	^ aMessage sendTo: self becomeAncestry!

Item was added:
+ ----- Method: MCInfoProxy>>setInfo:repository: (in category 'initialize-release') -----
+ setInfo: aMCVersionInfo repository: aMCRepository 
+ 	info := aMCVersionInfo.
+ 	repository := aMCRepository!

Item was removed:
- ----- Method: MCReader>>initialize (in category 'lifecycle') -----
- initialize!

Item was changed:
  ----- Method: MCRepository>>includesVersionNamed: (in category 'versions') -----
  includesVersionNamed: aString
+ 	"Subclasses may want to override for better performance."
+ 	^ (self versionNamed: aString) notNil!
- 	self subclassResponsibility!

Item was added:
+ ----- Method: MCVersionInfo>>withTrimmedAncestry (in category 'initialize-release') -----
+ withTrimmedAncestry
+ 	ancestors := Array empty.
+ 	^ self!

Item was added:
+ ----- Method: MCWorkingCopy class>>stubOldPackageInfos (in category 'cleanup') -----
+ stubOldPackageInfos
+ 	"Replace VersionInfo instances which are more than 10 versions behind with a MCInfoProxy which will dynamically re-retrieve them from the current repository if necessary."
+ 	MCWorkingCopy allManagers do: [ : each | each stubAncestry ]!

Item was added:
+ ----- Method: MCWorkingCopy>>stubAncestry (in category 'operations') -----
+ stubAncestry
+ 	"Stub all but the most recent 10 of my ancestry tree to save memory with a proxy which can be transparently accessed later, if necessary."
+ 	repositoryGroup ifNotNil:
+ 		[ | tenAgo count |
+ 		count := 0.
+ 		ancestry ancestorsDoWhileTrue:
+ 			[ : each | tenAgo := each.
+ 			(count := count + 1) < 10 ].
+ 		tenAgo stubAncestryUsing: repositoryGroup ]!

Item was changed:
  ----- Method: MCWorkingCopyBrowser>>flushAllCaches (in category 'actions') -----
  flushAllCaches
  	| beforeBytes afterBytes beforeVersions afterVersions |
  	Cursor wait showWhile: [
  		beforeBytes := Smalltalk garbageCollect.
  		beforeVersions := MCVersion allSubInstances size.
  		MCFileBasedRepository flushAllCaches.
+ 		MCWorkingCopy stubOldPackageInfos.
  		afterBytes := Smalltalk garbageCollect.
  		afterVersions := MCVersion allSubInstances size.
  	].
  	^self inform: (beforeVersions - afterVersions) asString, ' versions flushed', String cr,
   		(afterBytes - beforeBytes) asStringWithCommas, ' bytes reclaimed'!



More information about the Squeak-dev mailing list