how to free persistent data memory?

Hi,

Recently I have been working on card applet developing.In my applet I want to use EEPROM to hold a large file, so I apply byte array[] in class constructor.

In Write method I write data to the byte array[]; In Delete method I want to make the byte array[] null,so I used "byte array[] = null".

When I test it in emluator it works well, the data I wrote in the byte array can be removed. But when I test it in the real card, if I want to delete the file (equals with making the byte array null) I always got the error.

So I want to know how to free persistent data memory, dos "= null"work?

Thanks

[637 byte] By [Bobby_SHa] at [2007-11-27 7:42:26]
# 1
What error do you get?
lexdabeara at 2007-7-12 19:23:18 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

Java Cards are not required to support automatic garbage collection, although some do.

On Java Card there is a feature called object deletion which can be implemented as garbage collection but can also be implemented differently. Please read the related section in the Java Card Runtime Environment Specification.

With

javacard.framework.JCSystem.isObjectDeletionSupported()

you can check if object deletion is supported on your card.

With

javacard.framework.JCSystem.requestObjectDeletion()

you can request it for the next call of the process method.

And don't forget to clear all your references to the object which is to be deleted.

lionkinga at 2007-7-12 19:23:18 > top of Java-index,Java Mobility Forums,Consumer and Commerce...