Fixed `VMCrashTests >> test_newspace_resize`
Before shrinking new space, increase oldspace size to
make sure there's enough space to tenure objects to. See
comment `ObjectMemory >> newSpaceSize:`
--- a/RegressionTests__VMCrashTests.st Wed Oct 04 21:36:43 2017 +0100
+++ b/RegressionTests__VMCrashTests.st Thu Oct 05 22:31:06 2017 +0100
@@ -54,7 +54,7 @@
<spawn: true>
<timeout: 660> "11min"
- | timeout deadline iterStart iterStop directory files oldSpaceSizeLimit i |
+ | timeout deadline iterStart iterStop directory files oldSpaceSizeLimit i |
"/ See https://swing.fit.cvut.cz/projects/stx-jv/ticket/64
self skipIf: OperatingSystem isMSWINDOWSlike description: 'Temporarily skipped because of issue #64'.
@@ -64,27 +64,27 @@
deadline := OperatingSystem getMillisecondTime + ((timeout - 60"extra min to cover variance") * 1000).
iterStart := iterStop := 0.
i := 0.
- directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'.
+ directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'.
oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024).
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[
- iterStart := OperatingSystem getMillisecondTime.
+ iterStart := OperatingSystem getMillisecondTime.
- i := i + 1.
- Stdout nextPutLine: 'Pass ' , i printString.
- files := directory recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ].
- files := files select: [ :e | e suffix = 'st' ].
- files collect:[ :e | (FileStream fileNamed: e) contents asString ].
- Stdout nextPutLine: 'Pass ' , i printString , '...OK'.
- (oldSpaceSizeLimit notNil and:[ ObjectMemory oldSpaceUsed > oldSpaceSizeLimit ]) ifTrue:[
- Stdout nextPutLine: 'GC'.
- files := nil.
- ObjectMemory compressingGarbageCollect.
- oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024).
- Stdout nextPutLine: 'GC...OK '.
- ].
- iterStop := OperatingSystem getMillisecondTime.
+ i := i + 1.
+ Stdout nextPutLine: 'Pass ' , i printString.
+ files := directory recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ].
+ files := files select: [ :e | e suffix = 'st' ].
+ files collect:[ :e | (FileStream fileNamed: e) contents asString ].
+ Stdout nextPutLine: 'Pass ' , i printString , '...OK'.
+ (oldSpaceSizeLimit notNil and:[ ObjectMemory oldSpaceUsed > oldSpaceSizeLimit ]) ifTrue:[
+ Stdout nextPutLine: 'GC'.
+ files := nil.
+ ObjectMemory compressingGarbageCollect.
+ oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024).
+ Stdout nextPutLine: 'GC...OK '.
+ ].
+ iterStop := OperatingSystem getMillisecondTime.
].
"Created: / 04-09-2016 / 03:16:19 / jv"
@@ -134,9 +134,9 @@
].
"/ Now, allocate some really huge object
[
- String new: 300 * 1024 * 1024"300MB"
+ String new: 300 * 1024 * 1024"300MB"
] on: AllocationFailure do:[:ex |
- "/ Do nothing, allocation failure is valid error
+ "/ Do nothing, allocation failure is valid error
].
"Created: / 05-09-2014 / 19:44:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -157,9 +157,9 @@
newLimit := (ObjectMemory newSpaceSize * 0.9) rounded.
"/ Fill in new space so it's 90% full, no garbage.
- holder := OrderedCollection new.
+ holder := OrderedCollection new.
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[
- holder add: (Array new: 100).
+ holder add: (Array new: 100).
].
"/ Grow the new space to two times the current size.
ObjectMemory newSpaceSize: 2 * newSize.
@@ -169,17 +169,24 @@
"/ Fill in new space so it's 90% full, no garbage.
newLimit := (ObjectMemory newSpaceSize * 0.9) rounded.
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[
- holder add: (Array new: 100).
+ holder add: (Array new: 100).
].
- "/ Grow the new space to two times the current size.
+ "/ Increase old space to make sure there's enough
+ "/ old space to tenure objects to. See
+ "/
+ "/ ObjectMemory >> newSpaceSize:
+ "/
+ ObjectMemory moreOldSpace: newSize * 2.
ObjectMemory newSpaceSize: newSize.
self assert: (ObjectMemory newSpaceSize < (newSize + 4096"page size as tolerance for page aligning")).
- ] ensure:[
- ObjectMemory newSpaceSize: newSize.
+ ] ensure:[
+ ObjectMemory newSpaceSize: newSize.
].
"Created: / 21-09-2017 / 23:16:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 05-10-2017 / 22:28:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 08-10-2017 / 23:51:30 / jv"
!
test_stx_libjava_testSuite_inspect
@@ -205,4 +212,3 @@
^ '$Changeset: <not expanded> $'
! !
-