# HG changeset patch # User Jan Vrany # Date 1488208382 0 # Node ID 300cd20b8c033ddac6cdefad85b20fb455da1ce9 # Parent 44192c225011b9820480f82e2f6bf82daf1798e4 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?) diff -r 44192c225011 -r 300cd20b8c03 RegressionTests__VMCrashTests.st --- 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 @@ "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 " ! test_java_initialize