KF InvalidFormatException while loading a new application


I am currently working on a multi app project and I see a strange issue while loading a new application. I need to program 2 apps but every time I program the second app (whatever order I program them) I got the following message:

Exception in thread “Thread1” ej.kf.InvalidFormatException: code=2:ELF ERROR[8](451072)

I don’t think the problem comes from my ELF files as both work correctly when programmed as the first app.

Can you please help me to figure out what is wrong in my project?

Moreover, to easy my future debugs, do you have a documentation describing the errors that can return the InvalidFormatException class?

Thanks for your help,



This error is indirectly thrown by the embedded dynamic linker.

Error code 8 means that it was not able to allocate a memory chunk of 451072 bytes.

As you already linked a previous application, likely there is not enough memory available in your pre-allocated buffer to load the second application.
So you should check why your C implementation of LLKERNEL_IMPL_allocate returned 0 at this point.

You can retrieve these infos by browsing the sources the Foundation Library available in your Platform : [PLATFORM_DIR]/MICROJVM\javaLibs\kf-dd-1.1.jar

Just unzip the JAR file in the current folder to get the sources.

The following screenshot shows the error constant:


Hi Frédéric,

Thank you very much for your help. That was exactly what I needed. Indeed I only allocated 512kbytes of RAM to install the apps and each app was around 400kbytes.
Increasing the buffer to 1Mbytes fixed the issue.
Thanks also for the pointer to the java code of the kf lib. I didn’t know that I can find the foundation libraries code in that folder. That will certainly help me a lot for my future debugs.

Have a nice day,