[uClinux-dev] Minimum size of uCLinux and J9 compatibility

Chris Gray chris.gray at kiffer.be
Mon Feb 2 17:51:49 EST 2009


On Monday 02 February 2009 22:01:12 Jamie Lokier wrote:

> I didn't use Java because I thought it wouldn't fit, to be honest.
>
> There's about 10MB free on my 64MB device (32 allocated to video
> coprocessors, away from Linux; the rest is used by Linux, utils etc.)
> I found that's actually not enough when streaming from hard disk -
> because Linux's page allocator can't handle it, playback struggles.
>
> So I thought adding Java would make it worse.

It probably would have: you can certainly run Java applications in less than 
10 MB (or even 5 MB), but you need to keep them pretty simple (and when the 
memory consumption starts to grow it can be hard to put your finger on just 
why). OTOH I know people who are doing pretty complex stuff (including genetic 
algorithms, would you believe) in something like 18 MB.

There are some aspects of Java which make it hard to keep the memory 
consumption real down low - the reflection data for example (all those 
strings!) and the frustrating lack of modularity in the class libraries. Yes 
you can compile stuff AOT and strip out unused methods and reflection data - 
but be careful because the Java libraries themselves use reflection quite a 
lot. The good news is that once you have a certain critical mass of commonly-
used core classes from java.lang, java.io, java.net and java.util loaded the 
memory consumed by class libraries starts to stabilise a bit - provided of 
course that you don't start dragging in every cute open-source library you see 
on the web.

-- 
Chris Gray        /k/ Embedded Java Solutions      BE0503765045
Embedded & Mobile Java, OSGi    http://www.k-embedded-java.com/
chris.gray at kiffer.be                             +32 3 216 0369

Come and see us at Embedded World 2009 in Nürnberg, 3-5.3.2009:
Hall 12, Stand 560 (DSP Valley).  http://www.embedded-world.de/



More information about the uClinux-dev mailing list