Thanks, Colin. We've been running our load tests to try to measure where the best gains in RAM are. Reducing the use of local variables has been the biggest help so far.
I also have the following kind of code:
"
set myVar {
<20-30 lines of script>
}
catch { if 1 $myVar}
"
I used "myVar" as a kind of macro and invoked it 4 times in my iRule. Load tests showed that it was better (lower RAM usage) just to replicate the block of 20-30 lines throughout the iRule, as opposed to using my macro, even though "myVar" *should* be turned into bytecode.
Thanks for the responses to this thread.