Hi all,
I experienced a similar problem as Zac's, so I will try to answer the
questions from my own experience.
I had an application that could be very easily wrote using Java,
however, as you already noticed, for this *small* devices a complete JVM
is not a realistic option. But why?
First of all, because this *small* devices are very constrained in
memory, but offer something that is very valuable in the IoT: they can
run with batteries for a considerable amount of time.
This said, I will try to answer the question: Why it's not possible to
add lots of external memory? Well, because for instance DDRX RAM is VERY
energy consuming. Just to have an idea, make a comparison between the
typical energy consumption of a Raspberry Pi with only 512MB of RAM and
any Cortex MCU.
During my research, I was looking for the biggest MCU with lots of RAM
and ROM to be as less constrained as possible for my developments. I
found a Renesas MCU with 384KB of RAM, which seemed the biggest at that
time (2013), but also very energy consuming, that would not last more
than a day with added radio communication capabilities.
However, I found a ST Cortex-M4F with 256KB of RAM and 2MB of ROM, with
a reasonable energy consumption. This MCU has a SRAM 32-bit controller
that is able to manage external SRAM. With this you could say "oh great!
I will add lots of RAM and run my JVM"! but again, take a look to the
energy consumption of any external SRAM chip. A similar situation comes
with the use of any external ROM chip, like a SD card or similar, the
energy needed to use it is huge.
The conclusion is, if you want to run a complete JVM (i.e. openJDK) you
will need lots of ROM/RAM, which is not available in MCUs (I didn't find
any commercially available MCU with such amount of memory), but you
still have the SoC option, like a Raspberry Pi or similar.
As of my knowledge, RIOT itself will not limit you in any way to
implement a JVM, but if you're using a RPi you would prefer linux as OS.
So, if the energy consumption is not an issue for you, I would recommend
to use any SoC based device commercially available, if you don't want to
use a PC. Otherwise, the only option you have is the very limited JVM
that were developed for research purposes, such as Darjeeling, Maté or
any improved version of them. But still, take into account that running
a JVM will need energy, that is consumed constantly even if your
applications are doing nothing, compared to a native application that
consumes only when running.
I hope this answer some of your questions.
Best,
Francisco