1. A method implemented in an electronic device, the method comprising: obtaining information describing a first target system; using the information to estimate s maximum stack usage, the maximum stack usage: representing a usage of a stack of the first target system at a given time, related to executing a model on the first target system, determined without executing the model, and estimated by; representing function calls of the model as a function call tree, the function call tree having a plurality of invocation paths representing call chains in the model, and identifying a most expensive one of the plurality of invocation paths in the function call tree, wherein the most expensive one of the plurality of invocation paths is associated with a most-expensive-path stack usage for others of the plurality of paths; and setting the maximum stack usage to the most-expensive stack usage.