@@ -182,6 +182,7 @@ func (ce *memExecutor) Exec(uid string, ctx context.Context, model *spec.ExpMode
182
182
memRateStr := model .ActionFlags ["rate" ]
183
183
burnMemModeStr := model .ActionFlags ["mode" ]
184
184
includeBufferCache := model .ActionFlags ["include-buffer-cache" ] == "true"
185
+ avoidBeingKilled := model .ActionFlags ["avoid-being-killed" ] == "true"
185
186
186
187
var err error
187
188
if memPercentStr != "" {
@@ -210,11 +211,11 @@ func (ce *memExecutor) Exec(uid string, ctx context.Context, model *spec.ExpMode
210
211
return spec .ResponseFailWithFlags (spec .ParameterIllegal , "rate" , memRateStr , "it must be a positive integer" )
211
212
}
212
213
}
213
- return ce .start (ctx , memPercent , memReserve , memRate , burnMemModeStr , includeBufferCache )
214
+ return ce .start (ctx , memPercent , memReserve , memRate , burnMemModeStr , includeBufferCache , avoidBeingKilled )
214
215
}
215
216
216
217
// start burn mem
217
- func (ce * memExecutor ) start (ctx context.Context , memPercent , memReserve , memRate int , burnMemMode string , includeBufferCache bool ) * spec.Response {
218
+ func (ce * memExecutor ) start (ctx context.Context , memPercent , memReserve , memRate int , burnMemMode string , includeBufferCache bool , avoidBeingKilled bool ) * spec.Response {
218
219
args := fmt .Sprintf ("--start --mem-percent %d --reserve %d --debug=%t" , memPercent , memReserve , util .Debug )
219
220
if memRate != 0 {
220
221
args = fmt .Sprintf ("%s --rate %d" , args , memRate )
@@ -225,6 +226,9 @@ func (ce *memExecutor) start(ctx context.Context, memPercent, memReserve, memRat
225
226
if includeBufferCache {
226
227
args = fmt .Sprintf ("%s --include-buffer-cache=%t" , args , includeBufferCache )
227
228
}
229
+ if avoidBeingKilled {
230
+ args = fmt .Sprintf ("%s --avoid-being-killed=%t" , args , avoidBeingKilled )
231
+ }
228
232
return ce .channel .Run (ctx , path .Join (ce .channel .GetScriptPath (), BurnMemBin ), args )
229
233
}
230
234
0 commit comments