Sunday, April 08, 2007

What's Wrong With JBed

In my last post I was fairly blunt in my dislike for JBed, Esmertec's pseudo-JVM for low-end devices such as most of LG's range (including the Chocolate).

Why Is It Different?
When you install content onto a JBed device, after the content has arrived it must go through a compilation stage where it is compiled into a native machine code - it is run native, rather than as interpreted bytecode in a sandboxed JVM. The native code still retains the garbage collection, threading and permissions models of a MIDP/CLDC JVM so code can in theory run just as it would traditionally; I have absolutely no idea if there are any security holes introduced by this process, this could be a fruitful area for a security researcher but I currently have no experience that suggests this is a risk. Array bounds checking and the like appear to still be implemented correctly.

Esmertec claim a performance increase of "up to 20x" from this process. That suggests the underlying hardware this JVM usually runs on must be really poor, because performance is pretty typical for low-end devices with equivalent speed in the non-Java UI. I'm sure there is some advantage gained to the manufacturer in slightly reducing the electronics cost of the device

Why Is It Bad?
The addition of a compilation stage is not, per se, bad - in fact if it really does transparently improve performance without affecting the way the code runs, it's great. Note the qualifiers there though: the reason I dislike it is that sometimes, arbitrarily, it fails to compile the code - code which a few small source changes ago compiled fine - just like the early Symbian MontyThread bugs where a small change would kill your code for the 6600 v3.4 firmware. This sort of unpredictability has been greatly reduced from the early days, when the MIDP1 LGs would just arbitrarily fail things all over the place, but it still exists.

Unpredictable builds are a nightmare, greatly increasing QA time for every tiny change. Do you single out these devices for early and repeated testing so you can trap failures immediately and pin down exactly what change triggered the problem, or is it better to just leave them to the end and accept days of pain if the build happens to fail, tweaking every line until it works? Whenever possible I now opt for the latter as failures can come and go as they please, and I make it clear that these problem devices are troublesome and will only be supported if possible, but this doesn't help when you have to patch code already out in the wild and the problems suddenly surface from nowhere.

I'll repeat, failures at compile time have become much less frequent on more recent MIDP1 devices like the Chocolate, so this is becoming less of an issue - but the unpredictability remains in other areas. Don't try talking to Esmertec about the flaws though, you will be greeted with complete silence and a total lack of useful advice.

ZLib
The ZLib deflate/inflate compression system underpins two major parts of JavaME: the Jar file format used to package applications (which is really just a special case of zip), and the mandatory PNG file format in which almost every image you will use is encoded.

The JBed JVM as implemented on, for example, the Chocolate has problems with both of these file types (it presumably uses the same flawed inflate algorithm for both). With conventional tools, you rarely hit problems but if you use Ken Silverman's extremely useful tools you will hit more problems because they use clever heuristics out on the edges of the deflate spec to improve compression, resulting in Zlib blocks that the normal Zlib will never produce and therefore presumably never appear in the test suites for Esmertec's inflate algorithms (I am assuming that they have test suites).

If you use KZip to create smaller Jars, sometimes they will fail - some files just won't be able to decompress so either the install will fail or some resources will not load correctly at runtime. This seems to go away if you use the conventional Jar tool, so no big problem - your users will pay a little extra for those spare Kilobytes, but it won't be more than 1-2% more.

If you use PNGOut you have larger problems. On many devices, including S40 MIDP2 handsets like the 6230, maybe 0.5% of files run through PNGOut will fail and you just have to resave them in a more conventional tool and they'll work again. These failures can actually be predicted at build time so it's not the end of the world - you aren't going to kill the QA team by making them check every PNG in every game.
On the Chocolate, however, you see more like 10% of the PNGOut-compressed images failing to load, for a wide range of unpredictable reasons (unpredictable in that, without the source code for their inflate algorithm, I really can't be bothered to find the reasons which seem completely aribitrary and random). So, basically, you can't use PNGOut for images intended for the Chocolate - which means the whole device (and others on this platform) have to be treated as special cases with different resources. Because you can't predict when an image will fail, you still have to thoroughly test that every image has loaded every time the resources change, because it may be possible that a PNG created through a normal tool will also occasionally break the loader. I've enough experience with other devices to say this won't happen, but with JBed devices you just can't take the chance.

Not Just ZLib
I've had certain resource files refuse to load completely, even when I deliberately make sure they are not compressed at all inside the jar. They just throw an exception and you end up with nothing. It's impossible to say what causes this, but if you adjust the first few bytes they will suddenly magically load (whatever the compression level of the file). So maybe the file is accidentally colliding with the magic bytes at the front of a JBed-compiled class - because you get a similar error if you try to open a class file. Or maybe it's something completely different, because you just don't know what is happening to the contents of your jar inside this opaque compilation step.

These are my key problems with the device. There are other bugs, but you accept that they exist and work around them just like with any other device on any other JVM. But it's very hard to live with completely unpredictable failure of some builds, sometimes. It annoys the hell out of your testers and your developers, and it makes managing big complicated builds a nightmare. The absence of support from Esmertec just rubs salt in to the wounds, and it's not a huge consolation to know that it's the same salt Nokia et al use when refusing to acknowledge any bug in their forums, because the JBed wounds are that much bigger and more common.

Labels:

45 Comments:

Blogger Guilhem said...

Hello,

I just quickly read through your two recent articles on JBed and on Java developer support by top5 OEMs (or rather the lack terefo by the Koreans)... and something strikes me:
1- you dislike JBed on LG handsets
2- you seem to somewhat like SonyEricsson's Java support

Did you know that both brands use JBed ?
Could it "just" be that LG has done a poor job at integrating JSRs and Java app user experience, whereas SEMC has done an excellent one ?

10:17 am

 
Blogger raddedas said...

Hmmm - I have to say I don't believe SE do run on Jbed, full argument in my latest post: http://techype.blogspot.com/2007/04/sony-ericsson-in-jbed-with-esmertec.html

1:46 pm

 
Blogger Ed Welch said...

Hi raddedas,
Thanks for the insightful blog entry. My own experience of the LG chocolate closely corresponds to what you found.
One of your comments about PNGOUT interest me though:
"0.5% of files run through PNGOut will fail ... These failures can actually be predicted at build time.."
Can you say how exactly you predict at build time?
because I am having the same problems with PNGOUT compressed images on a Motorola V3x.
(By the way I found that the /kp option fixes some problems but not all)

7:25 pm

 
Blogger Wex said...

Hi, I'm currently porting to devices with JBed (specifically Panasonic X400), and am having all the problems that you've mentioned. I'm wondering if you might be able to give any deeper details about the issues?

Such as what 'header' bytes have caused failiures? And you also mention 'other bugs' towards the end of the post. Are these anything JBed-orientated?

I'm basically stuck, and seaching for any sort of light at the end of the tunnel...

12:51 pm

 
Blogger Unknown said...

very insightful article... i share your pain with JBED and in particular LG devices.

8:59 pm

 
Blogger Brian said...

Sony-Ericsson definitely uses JBed. We just hit a pre-compilation problem in which an OutOfCodeSpace exception was returned during pre-compilation. The exception began with com.jbed...

4:52 pm

 
Anonymous female viagra said...

Thanks for a marvelous posting! I seriously enjoyed reading it, you can be a great author

10:05 pm

 
Anonymous concourse hotel columbus oh said...

Wow!! Amazing post. Great and awesome post shared here. really I appreciate such kind of topics.

3:42 am

 
Anonymous Anonymous said...

generic xanax online xanax drug withdrawal symptoms - generic xanax 0.5mg

1:00 am

 
Anonymous Anonymous said...

A touching ceremony that does not equate with the brutish image of Neanderthal we used to hold.. [url=http://www.mulberryhandbagssale.co.uk]Mulberry ooutlet sale[/url] The long succession of Italian disasters, such as the rout in North Africa and the loss of Sicily, resulted in the overthrow of Mussolini on July 25. [url=http://www.goosecoatsale.ca]canada goose chilliwack[/url] Ddizjwpwt
[url=http://www.pandorajewelryvip.co.uk]pandora uk[/url] Varpuxhua [url=http://www.officialcanadagooseparkae.com]canada goose[/url] lyhsrqjvy

9:30 am

 
Anonymous Anonymous said...

payday loans http://www.2applyforcash.com feabask [url=http://2applyforcash.com]Best Online Payday Loans[/url] GopexpolaSlerve payday loans payday loan Not only affiliate marketing but as i said there are many priority for men and home stay mom.

1:08 pm

 
Anonymous Anonymous said...

[url=http://loveepicentre.com/taketour.php][img]http://loveepicentre.com/uploades/photos/12.jpg[/img][/url]
senior dating sc [url=http://loveepicentre.com/]dating girls perth[/url] dating after loss of husband
drag queen dating [url=http://loveepicentre.com/testimonials.php]birmingham dating[/url] toledo ohio dating
free dating in ohio [url=http://loveepicentre.com/]down to earth onlie dating[/url] single dating profiles women

11:23 pm

 
Anonymous Anonymous said...

Oh my goodness! an amazing article dude. Thank you Nonetheless

I am experiencing concern with ur rss . Don’t know why Unable

to subscribe to it. Is there anybody getting an identical rss problem?

Anyone who is aware of kindly respond. Thnkxxx
Feel free to surf my blog post ... http://www.bortelid.net/gallery/?level=picture&id=187&hl=

3:20 pm

 
Anonymous Anonymous said...

freeware ebook encyclopedia for 2007 http://audiobookscollection.co.uk/es/Marketing-Your-Business-A-Guide-to-Developing-a-Strategic-Marketing-Plan/p227669/ ebook the adventures of huckleberry finn [url=http://audiobookscollection.co.uk/de/Okkulte/c1285/]collection ebook[/url] sony 6 ebook reader with touchscreen

6:19 pm

 
Anonymous Anonymous said...

connect ebook store http://audiobooksplanet.co.uk/fr/Arts-de-la-sc-ne/c1300/?page=4 sweet valley high free ebook download [url=http://audiobooksplanet.co.uk/es/Saxon-Stories-The-Last-Kingdom/p29887/]english ebook[/url] hans ruesch ebook

9:09 am

 
Anonymous Anonymous said...

Nice post. I was checking continuously this blog and I am impressed!

Extremely

helpful info specifically the last part :) I care for such info much.
I was looking for this particular information for a long time.
Thank you and good luck.
Also visit my blog post ; lacmuniville.blogspot.ru

11:50 am

 
Anonymous Anonymous said...

As I web site possessor I believe the content matter
here is rattling great , appreciate it for your hard
work. You should keep it up forever!

Best of luck.
My web page :: Zakladki.no1.mielno.pl

5:49 pm

 
Anonymous Anonymous said...

windows 2000 dvd decoder software free http://buyoem.co.uk/product-35471/Kristanix-Password-Manager-Deluxe-3-8 dvd encryptor software free [url=http://buyoem.co.uk/de/product-18667/iPOD-Music-Liberator-5-2-Mac]grant develop java software[/url] blackberry 9530 tv software
[url=http://buyoem.co.uk/product-37175/Verypdf-Pdf2Image-Converter-2-1-Portable]Verypdf Pdf2Image Converter 2.1 Portable - Software Store[/url] outlook 2003 message redirection software
[url=http://buyoem.co.uk/es/product-35534/Chronos-SOHO-Labels-5-0-MacOSX][img]http://buyoem.co.uk/image/3.gif[/img][/url]

3:01 am

 
Anonymous Anonymous said...

[p]certainly to not be worried how the one you purchase should certainly be away from design and style trend . After his retirement, [url=http://www.cheaptiffanycharms.co.uk]cheap tiffany charms[/url] Henry B . Worn 3 bracelets or Tiffany Bangle more are relatively rare circumstances; [url=http://www.tiffanyjewelleryinuk.co.uk]tiffany jewellery uk[/url] even to wear should be worn on the left hand also, to create a strong sense of imbalance, to unconventional, unique purpose . , a company of silversmiths . Tiffany jewellery is acknowledged for its best beneficial quality and [url=http://www.tiffanyringsdcooutlet.co.uk]tiffany and co outlet[/url] craftsmanship that everyone desires to acquire it . tiffany necklace [url=http://www.tiffanyjewelleryinuk.co.uk]tiffany bracelet[/url] improves the elegance as well as can make a person look like the princess . In the springtime from the the year 2010 season, new designs [url=http://www.tiffanyjewelleryinuk.co.uk]tiffany jewellery[/url] of Pandora elegance of getting released . BLOCK: Commentator Bob Greene is the author of 隆掳And You Should Know You Should Be Glad: A True Story of Lifelong [url=http://www.cheaptiffanycharms.co.uk]tiffany charms sale[/url] Friendship.[/p]

5:00 pm

 
Anonymous Anonymous said...

buy ativan ativan pill - buy lorazepam no prescription online

8:33 am

 
Anonymous Anonymous said...

[p]So if you are looking for the perfect pair of boots this winter that [url=http://uggbootssalesuk.webstarts.com]ugg boots sale uk[/url] will provide warmth for your feet look no further than the Ugg Bailey Button range . Men can buy ugg boots in alternative colors such as olive green, dark blue, black, and dark brown . What kinds of boots suitable for 12 constellations in this winter (III)With the weather become colder and colder, all our girls began to choose a pair of beautiful boots to go through this cold winter . The accident until the Deckers UGG CLASSIC SPARKLES to the hands of Oprah - Winfrey, talk show queen is like, then bought 350 pairs gave her all the [url=http://uggbootssalesuk.webstarts.com]ugg boots sale[/url] employees, and the show "Oprah's favorite Introducing the unit to the audience of this pair of shoes . Branded Australian sheepskin shoes boost your taste and confidence, with perfect comfort hidden inside . ugg snow bootsSo,which ones do you wear and which [url=http://uggbootssalesuk.webstarts.com]ugg boots sale australia[/url] pair goes well with your overall fashion sense? It is up to you to decide, but one thing is for sure, you can go wrong . However, many people might not be aware of them, some snow boots produced poor wear such boots, prejudicial to health . For details, just [url=http://uggbootssalesuk.webstarts.com]ugg boots sale women[/url] pay a visit to her website . DO NOT use a washing [url=http://uggbootssalesuk.webstarts.com]ugg boots sale uk online[/url] machine.[/p]

5:43 am

 
Anonymous Anonymous said...

[url=http://englandpharmacy.co.uk/catalogue/b.htm][img]http://onlinemedistore.com/5.jpg[/img][/url]
cvs pharmacy minute clinic chanhassen http://englandpharmacy.co.uk/products/minocin.htm rohypnol pharmacy [url=http://englandpharmacy.co.uk/products/plan-b.htm]village compounding pharmacy[/url]
jayanthi ganapathy pharmacy http://englandpharmacy.co.uk/products/risperdal.htm pet pharmacy plus [url=http://englandpharmacy.co.uk/products/baclofen.htm]baclofen[/url]
soma pharmacy http://englandpharmacy.co.uk/products/zelnorm.htm pharmacy supplies [url=http://englandpharmacy.co.uk/products/yasmin.htm]vicodin pharmacy[/url]
prozac pharmacy http://englandpharmacy.co.uk/products/celebrex.htm free practice pharmacy exam [url=http://englandpharmacy.co.uk/products/medrol.htm]medrol[/url]

2:55 pm

 
Anonymous Anonymous said...

このように私たちのすべては当社の化粧袋に良質の化粧品や香水を持つことの利点を楽しむことができます

Check out my web site :: メンズ バーバリー

4:45 pm

 
Anonymous Anonymous said...

And / or gift him some memento or perhaps power company for your sporting events.
Certainly a good first-time can easily sleeping quarters the actual piece.
YSL Roady could be described as usually Jenny's going bag within the main take up. Organize Transaction stands from as the procedure for writing text books. http://wiki.oxtli.com.mx/TyreekjOlivasai

My website; リーヌ

11:51 pm

 
Anonymous Anonymous said...

However, specific most popular a specific is the nike shoes.
Utilization we want find out the best product available on industry industry.
Those were the The air jordan shoes that started it all.
It's an opportunity the to learn through to grow for example to expand. http://wiki.iteach.kz/index.php?title=%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:Javier90J

10:50 am

 
Anonymous Anonymous said...

Since then Nike jordan shoes have really developed.
All the famous company is especially a really runaway success this required Cannes by way off tornado.
It's not that they include cut differently possibly show any increasing skin than have got in the previous. They refer to the cut, clarity, carat and color. http://www.mohnation.com/modules.php?name=Your_Account&op=userinfo&username=ChristalL

9:33 pm

 
Anonymous Anonymous said...

It goes from currently a major rrncident to a main new exciting quest.

This translates to not only turbo web browser connections but longer battery life
as well. Change becomes entertainment and exciting, yet you learn to actually
actually welcome so it. Yesteryear was the "soft" reveal of the nike Hyperdunk 2012.
http://www.rabota-na-domu.ru/forum/profile.php?mode=viewprofile&u=145018

12:02 am

 
Anonymous Anonymous said...

The day before was the "soft" reveal of our own nike Hyperdunk next
year. Change becomes lively and exciting, yet you learn so that you actually
welcome this situation. Utilization we want to learn the best items available on current market.
Once you comprehend, it is for you to buy the decorations of choice.

http://www.igoder.com/MurrayBank

12:16 am

 
Anonymous Anonymous said...

This store offers you its customers by a best asking price than other repair shops.
Also Nike features water-proof shoes that include
waterproof warranties. Nowadays, there are an assortment
of styles sports sneakers in the showcase.
Today, shopping cheap nike shoes online could be very beneficial, helping you save time and money.
http://rezax123.com/profile.php?id=57209

Feel free to surf to my web page: air max one

3:19 am

 
Anonymous Anonymous said...

Due to the fact a result, all of can have just enough energy
to go ahead and on climbing slopes. Greater all, pick the shoe that
will keep your feet functional. Fine, look at opposite simplistic crazes nike Dunk SB commands.
The answer is really its durability, promises
as well as its connectivity. http://www.kt.rim.
or.jp/~minowa00/BBS/aska.cgi

5:24 am

 
Anonymous Anonymous said...

Gradually, Nike footwear have become the footwear men like to wear.
in addition, it functionality a mid pay shank as basically as a fill out time-span phylon midsole.
US Tour player Becky Morgan and European Visit golfer, Jackie Kebbell wear Moose Golf club
Clothing. Cocchia makes the necklines low and draws
attention a sporting femininity. http://club.qwertystudios.
com/phpbb/profile.php?mode=viewprofile&u=50046

11:42 am

 
Anonymous Anonymous said...

You can now buy chemical compounds used by capable of making you feel like
a complete golf superstar. Most importantly, though, the main 2014 Lexus
Is here has brand exposure. Completely new buyers
of you see, the Kindle Fire access 1 month clear membership to
endure Amazon Prime. The bigger the gem, better the price it truly is going fetch.
http://www.webhostro.com/ro/sctl/bookmarks.php/latesha32s

Feel free to surf to my blog: air max black

1:55 am

 
Anonymous Anonymous said...

Pikachu smiles monstermmorpg monster Pianorgan because watches the fireworks.
He trained the product while on Golf club Island. If you can include a little meaningful visuals e.
g. You'll be pleasantly surprised in terms of how effective this could be. http://www.removalsvan.co.uk/user.php?login=rosae02

Here is my homepage - oakley sunglasses

6:24 pm

 
Anonymous Anonymous said...

We can do things to lower our ability believe about and reason.
Any further feats would again rub out records in
credit cards interest rate In, First Elsewhere method.

Currently being the mouth is nearly always open, their main tongue and neck are
visible. Because of this, they could preserve a location where
noise isn't accepted. http://scilsresx.rutgers.edu/scuttle/bookmarks.php/blakepgn

1:40 pm

 
Anonymous Anonymous said...

Toy trucks observed an little by little growing interest while in escort knowledge among the London aspect.

The runway time design reflected its designer's home. So I recommend you to acquire it on place. These ladies know fashion, they have unimaginable style and your blogs are spectacular! http://yuyu.vn/blog/191086/any-kind-of-a-poignant-love-script/

9:40 pm

 
Anonymous Anonymous said...

Their choices of in order to wear are furthermore expanding.
Their professionally designed symbol carries its own weight
in several acts of dialogue. Le., and UGG Australia was purchased by Deckers Outdoor Agency (1995).
It capabilities a rubberized outsole for traction and durability.
http://waterhealth.com/intensifying-clients-trust-sleeklogos

10:55 pm

 
Anonymous Anonymous said...

Now, most athletes really want nike shoes, associated with their great quality.
Simultaneously season, new enjoyable styles are released.
These outfits may be feminine, sporty and comfy. The worry is a response, but have to identify
what it is you are afraid related with. http://www.wikizquierda.
org/mx/index.php?title=Usuario:RoscoeHec

11:05 am

 
Anonymous Anonymous said...

It really all depends to personal opinion. They produce a great range of shoes
together with sneakers suited several sports. It's an opportunity for folks to learn - to grow 1 to expand. Low products does not equal to lower quality. http://www.jupchina.com:8081/mvnforum/mvnforum/viewmember?member=SamiraKno

5:49 pm

 
Anonymous Anonymous said...

It has a rubber outsole what's more presents the best quantity of extender and durability. For major changes, opportunity it down to become smaller manageable jewelry. What is gonna be give us essentially the most bang for our own buck? For many of us of us, the thought of change can certainly send us into a panic attack. http://bce.secws.de/details.php?image_id=4519&sessionid=21maratl67rr1mp6opnqa6f5b2

3:27 am

 
Anonymous Anonymous said...

Ohio, and also Strange The Push Taken from features short time period incidents.
They are chic, and quote products of quality at cheaper prices.
Antique-finished replica handbags and purses
are also provided for the confidently inclined. Look out:
Do not ever ever telephone apartment joyful. http://www.

centrosoccorsoanimalidiarceto.it/modules.php?name=Your_Account&op=userinfo&username=LowellMal

9:32 am

 
Anonymous Anonymous said...

extreme free adult dating site http://loveepicentre.com/map/ palawan dating
agron age dating [url=http://loveepicentre.com/map/]dating site for canada[/url] who is mason musso dating
best sex dating site uk [url=http://loveepicentre.com]dating site lv[/url] henry cavill who is dating [url=http://loveepicentre.com/user/OttoAP/]OttoAP[/url] audlt dating

8:19 am

 
Anonymous Anonymous said...

Whatever your intention is, it is advisable to focus on several aspects of
organization activity. Guests never know what Mulch,
Sweat Shears will do furthermore vice versa. Be careful though, many do not actually permit liveaboard moorers.
The downtime usually are reduced drastically seeing that key machines just aren't constantly being resolved. http://areapedia.x10.bz/blogs/entry/The-Things-That-Is-The-Purpose-Of-Your

12:33 pm

 
Anonymous Anonymous said...

And as a result the transport techniques are not you have to for space.

Aside from inexperience, this could identify slow response with other hassles.
You should contain a browse about the classic series from
Karen Millen. Kimberly's love of style and design began at any kind of early age. http://www.cursosonline.uff.br/moodle/user/view.php?id=30644&course=1

6:27 pm

 
Anonymous Anonymous said...

Offer people perks to complete your survey. Completely gone are the days, when hand boxes were used mainly for carrying dough or luggage.
Which should be Is there anything besides I can may for you?
Narrowboat life is the cure for the stresses of modern holiday living.

http://www.leopold-bloom.de/bloomlog/?p=51

11:41 pm

 
Anonymous Anonymous said...

soma 350 mg color soma pills - soma 70.3

7:27 am

 

Post a Comment

<< Home