Friday, October 21, 2005

Spot the difference?

For her birthday, I bought my wife a new mobile phone, after much background research. She wanted one with a camera, but the fact it also runs Java games is a bonus. She's a Tetris fanatic, but unfortunately that game didn't come on the phone by default. So, I spent some time last night looking for a good implementation and came across this version, which downloaded first time and plays like a charm.

However, this got me thinking. The jar is small, at only 18.29K. There are versions designed for the PC that are larger (e.g., this one is 744K), but not huge in the grand scheme of things. Yet when I run the game on the mobile phone, the resources it takes are tiny compared to when I run it on my PC! I know it's the difference between J2ME and J2SE environments, but you've got to wonder: how much of the latter do you really need to run your everyday projects?

I know there's a lot of work going on around Java microcontainers, but maybe we also need effort in micro-JVMs, similar to micro-kernels of old! Time for the big monolithic JVM to bow out, I think.

2 comments:

Yakov Fain said...

Twenty years ago we used to count bytes in memory and programmers were trying to squeze into a small ram a decent program. Now we're lazy and do not think of a wasted memory by J2SE.

As more memory will become available in the mobile phones, the footprint of tetris will become bigger. This is a natural way of technology evolution

Mark Little said...

Hi Yakov. It's not actually the footprint of tetris that's the concern (although I do remember writing a version for the BBC computing, which has a max of 32k in those days): it's the VM (in the case of Java).

Although there is the old adage that work will always expand to fill the resources available to it, I think in this case it would be wrong to assume that is the right direction to take.