SnapshotRestartTests: do a compressing GC after some iterations
...when used oldspace exeeds currently used space + 128MB. This has
two reasons:
* it stresses oldspace compatcion algorithm
* it keeps the memory usage low so test won't run out of memory
on low-memory hosts (low means < 1GB these days, funny isn't it?)
--- a/RegressionTests__VMCrashTests.st Mon Feb 27 10:11:32 2017 +0000
+++ b/RegressionTests__VMCrashTests.st Mon Feb 27 15:13:02 2017 +0000
@@ -41,7 +41,7 @@
<spawn: true>
<timeout: 660> "11min"
- | timeout deadline iterStart iterStop directory files 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'.
@@ -52,6 +52,9 @@
iterStart := iterStop := 0.
i := 0.
directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'.
+
+ oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024).
+
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[
iterStart := OperatingSystem getMillisecondTime.
@@ -61,11 +64,18 @@
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"
+ "Modified: / 27-02-2017 / 12:10:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
test_java_initialize