Sunspot 为sensor嵌入式系统以及sensor设计,rev6 hw配置512k RAM,4M Flash
其内存使用情况大致如下,注意:
1 其中used数字取自2006年,随着版本增长,多数都已经偏小
2 实际Flash比RAM大8倍,两图比例尺不一样,右下角有1 square = ?KB
****** native ******
紫色部分为native code,flash中存储时也称作binary,区别于javacode的suite格式。体积约一百多K。 我发现这个bin格式似乎和elf还是有所区别,暂时没有搞清楚build流程,以后再发文研究之。
在运行时,这些native代码很省ram,8K+16K+5K全搞定了
******* GC *******
GC比较特殊,是用java写的,转换成C的,不男不女,右图中用个黄色标出,忽略之....
****** javaheap ******
右图可以看出,在squawk启动后,系统只占用14K左右的javaheap,其余都留给user app
这14K heap都放了什么,不得而知,我猜object, class, string等类的头部大概被加载进来了吧... 也许还包括含有main方法的启动时需要的一些class...
****** flash中的java suite ********
而大部分的系统class,及其method bytecode本身,并不需要被加载到ram中,而是以execute in
place的方式留在左图的flash中,直接被vm使用。
存储方式不是class格式,而是sun称之为suite的一种compacted和prelinked格式。有点像android里面dex的概念。
图片摘自:
JavaTM on the Bare Metal ofWireless Sensor Devices
The Squawk Java Virtual Machine
Doug Simon
Sun Microsystems Laboratories
16 Network Drive
Menlo Park CA 94025, USA
doug.simon@sun.com
Cristina Cifuentes
Sun Microsystems Laboratories
Level 10, 80 Albert Street
Brisbane QLD 4000, Australia
cristina.cifuentes@sun.com
Dave Cleal
Syntropy Limited
2 Stambourne Way, West Wickham
Kent BR4 9NF, UK
dave@syntropy.co.uk
John Daniels
Syntropy Limited
2 Stambourne Way, West Wickham
Kent BR4 9NF, UK
jd@syntropy.co.uk
Derek White
Sun Microsystems Laboratories
One Network Drive
Burlington MA 01803, USA
derek.white@sun.com
阅读(540) | 评论(0) | 转发(0) |