-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9f8b28
commit c573613
Showing
2 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
#Requires GS_HOME variable defined | ||
#! /bin/sh | ||
#set -x | ||
$GS_HOME/bin/startTopaz devKit_34 -il <<EOF >>MFC.out | ||
set user DataCurator password swordfish gemstone devKit_34 | ||
login | ||
exec | ||
| handler commitThreshold | | ||
| handler commitThreshold usedMemory | | ||
commitThreshold := 65. | ||
handler := AlmostOutOfMemory addDefaultHandler: [ :ex | self halt ]. | ||
commitThreshold := 80. | ||
handler := AlmostOutOfMemory addDefaultHandler: [ :ex | | ||
Transcript show: ('AlmostOutOfMemory: ', ex printString); cr. | ||
System commitTransaction ifFalse: [Transcript show: 'AutoCommit failed'. nil error: 'AutoCommit failed' ]. | ||
System _vmMarkSweep. "GC executed to remove unnecessary objects" | ||
Transcript show: ('GC Executed'); cr. | ||
usedMemory := System _tempObjSpacePercentUsedLastMark. | ||
Transcript show: ('Used Memory: ', usedMemory printString); cr. | ||
(usedMemory < commitThreshold) | ||
ifTrue: [System enableAlmostOutOfMemoryError]"we are cool the memory droped below threshold" | ||
ifFalse: [(ObjectLogEntry trace: 'AlmostOutOfMemory' object: (System _vmInstanceCounts: 3)) addToLog. | ||
System commitTransaction]. | ||
ex resume. | ||
]. | ||
SessionTemps current at: #'AlmostOutOfMemoryStaticException' put: handler. | ||
System signalAlmostOutOfMemoryThreshold: commitThreshold. | ||
[BpmAppLinuxScripts startZnPortsScript] | ||
on: AlmostOutOfMemory enable | ||
do: [:ex | ex error: ex description]. | ||
BpmAppLinuxScripts startZnPortsScript. | ||
% | ||
exit | ||
EOF |