Skip to main content

Amount of RAM needed?

6 replies [Last post]
manuelnaranjo
Offline
Joined: 2006-06-26
Points: 0

Hello guys,

First of all WHAT A GREAT job :D! The code looks like a Swedish watch, each piece comes into the right place, and there's not a single square mm non used.

I have some interesting projects ahead, and one of those project is see if we can port a JVM like squawk to a sort of ARM processor (it's not a real ARM it's a VM compliant with an ARM architecture).

There's an OS running on the processor, so we have stuff as files and everything. Actually we even have a bluetooth radio on the chip, well to be honest we are using the bluetooth chip, and using some extra free space for other stuff, and we would like to get squawk there, thing is we have limited RAM. And that's a real issue, and I'm sure that can be an issue for a JVM.

I've been through most of the c code, and only find something that might help on: vmcore/src/vm/squawk.c.spp but in that file it's defined as macros. And I got worried as it gives me about 8MB of RAM, while if I can ask 1MB to this processor then I'm rich.

Ok it's 2AM my mind isn't at it's best state at this time of the night, so I'll be ending the mail, I will look forward for your reply,

Thanks a lot,
Manuel Naranjo

PS: Keep the GREAT job please !!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
zallmoe
Offline
Joined: 2008-03-06
Points: 0

Hello all,

am also interesting in such kind of projects , i would like to ask what kind of test or procedure or tool you use to measure the amout of memory allocated for your HelloWord program ?

Thanks in Advance
Zalloom

derek_white
Offline
Joined: 2006-09-08
Points: 0

The test procedure was pretty simple - it was something like:

System.out.println("Hello World");
System.gc();
System.out.println("Total memory used: " + System.getRuntime().totalMemory());

This was run on a SPOT, but with a little effort to reduce the impact of the libraries. It may have run against the spot library instead of the transducer library (which includes extra code to run LEDs, accelerometer, etc.).

The test was done a while ago, and may have changed, especially due to more code in the spot libraries, but the basic footprint for Squawk should be similar.

derek_white
Offline
Joined: 2006-09-08
Points: 0

I should mention that when I talk about "more code" above, I'm really only concerned about startup code that might allocate objects in the heap. The code itself is in ROM of course.

tanguito
Offline
Joined: 2008-06-02
Points: 0

Hi!
I'm new to his project. It seems very interesting.
I've a doubt about your post where you say:
[i]"it's not a real ARM it's a VM compliant with an ARM architecture" [/i]
I'd like to know what makes a microcontroller architecture "VM compliant"?. In other words I'm trying to figure out the device scope targeted by squawk.
I've got some experience using AT91SAM7 and it would be great to use an OO languaje in my develompents.
Thank you,
Luis Alvarado Day

eric_arseneau
Offline
Joined: 2004-07-15
Points: 0

First off thank you for the compliments.

In our view Squawk is still too big for our liking, but this is due to our intended targets.

The Sun SPOT has 4 MB of Flash and 512K of RAM. The VM + the bootstrap are currently around 140K + 380K, so you need a minimum of 512K flash. As for RAM, I think we use around 14K for hello world at the moment. So I think the RAM requirements are quite low, even if they are not low enough for our liking :) The 512K of RAM allows us to a LOT on the Sun SPOT.

The 8MB you see in the squawk.c are the amount we allocate when Squawk is running on a desktop.

Does this help ?

manuelnaranjo
Offline
Joined: 2006-06-26
Points: 0

Thanks Eric,

That really helps. My main issue is that this processor is quite strange, there's a Base Band Radio there for Bluetooth, and the code we add to the processor is shares the memory with the Base Band, so you can start asking for RAM freely.

Furthermore there's a sort of memory slots pool, it's a table that says you have X slots of Y bytes, but I think you can only make 32 calls to malloc.

Flash for us is not an issue, we have about 8MB, what it's really an issue is the amount of RAM.

So well I'll take a look and see if I can something to work. I'll start with the easy way, and see if I can get this thing to compile against the libraries and compiler our provider gave us (it's gcc, and there's POSIX C library, so it shouldn't be a pain).

Ouu before I forget, what about adding a Wiki to the site?, then everyone can collaborate and add some docs to the project.

Thanks a lot, I'll keep you guys informed,
Manuel