Skip to content

Commit

Permalink
fix #434
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Nov 22, 2018
1 parent d9f8b28 commit c573613
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
22 changes: 16 additions & 6 deletions start-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@ $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 startAllScript]
on: AlmostOutOfMemory enable
do: [:ex | ex error: ex description].
BpmAppLinuxScripts startAllScript.
%
exit
EOF
23 changes: 17 additions & 6 deletions start-zn.sh
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

0 comments on commit c573613

Please sign in to comment.