Calculating image size

I want to limit the e2prom size used by my applet druing installation.How can I calculate the total size of non-volatile data used by my applet?
[159 byte] By [nrafa] at [2007-9-28 14:07:58]
# 1
The used eeprom memory depends on the card's internal data structures so there is no easy way to find out.Try to get information on free eeprom memory before and after package loading/applet installation.
lionkinga at 2007-7-12 10:28:50 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

Maybe I'm very confused, but you KNOW what your applet is allocating if you are doing your allocations DURING install. You shouldn't be doing dynamic allocations during processing. You run the risk of not having memory available if you attempt it during processing.

JC22 offers a implementation to query your memory.

DurangoVaa at 2007-7-12 10:28:50 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3

You were right that you KNOW what your applet is allocating.

Allocating memory only during installation as general rule is the only way to go. :-)

But you certainly do NOT KNOW what the system additionally allocates for managing the objects of your applet.

Example:

myAppletInstanceVariable = new byte[6];

This certainly allocates at least 6 bytes of EEPROM on the card.

The system needs information on object owner and object context in order to support the applet firewall.

This information could be stored with the object data as some kind of internal meta data and this would certainly require additional EEPROM space.

Otherwise the object could be linked into a system list somewhere so that information on object owner and object context can be derived and no additional space is required.

It depends on the used card which approach is taken. Therefore you have to be careful in estatimating the used memory from the applet's allocations alone.

I hope this helps.

lionkinga at 2007-7-12 10:28:50 > top of Java-index,Java Mobility Forums,Consumer and Commerce...