> But can that JIT/AOT work on a chip with less than 20 KB ram?
In all honestly 20KB of RAM is not much if you have a "typical JIT" - assuming you can load the bytecode from Flash, then you need space for: output JIT'ted code, the JIT itself, any interpreter support, two stacks (one for JIT/interperter and one for code), and then any data your program is actually using.If you can restrict the bytecode to something simple (relatively flat mapping to the hardware ISA), and have a design with a very limited support library then it could be done. This type of micro-bytecode has found use in some boot-strap type code in many devices (BIOS chipsets often run a bytecode). Assuming you want to JIT something like full Java, then probably not possible in 20K, but then I've never really tried either.
To be honest, It's harder to have a big ram than to have a big flash, isn't it?