MemoryLimit enables memory tracking and configures program evaluation to exit early with a "memory limit exceeded" error if the peak tracked memory exceeds the limit. The MemoryLimit is a metric that corresponds to the aggregate element counts of the values observed during evaluation. It is indicat
(memLimit uint32)
| 959 | // observed during evaluation. It is indicative of memory usage, not CPU usage; see CostLimit |
| 960 | // for bounding compute. |
| 961 | func MemoryLimit(memLimit uint32) ProgramOption { |
| 962 | return func(p *prog) (*prog, error) { |
| 963 | p.memoryLimit = &memLimit |
| 964 | p.evalOpts |= OptTrackMemory |
| 965 | return p, nil |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | // CostLimit enables cost tracking and sets configures program evaluation to exit early with a |
| 970 | // "runtime cost limit exceeded" error if the runtime cost exceeds the costLimit. |
no outgoing calls