Page 1 of 1

Is there any way to find out how much memory size has my applet taken up?

Posted: Thu Feb 15, 2018 1:48 am
by Squli
Is there any way to find out how much memory size has my applet taken up?
can anyone help me ?

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Thu Feb 15, 2018 1:00 pm
by Ponele
COR ? COD? Or Persistent Memory?

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Fri Feb 16, 2018 5:06 am
by Tolice
You can write another applet to get your applet size, as following steps:
- 1, Get card memory size named M1;
- 2, Load your applet to the card and get card memory size named M2;
- 3, Your applet used memory size named M, and M = M1 - M2

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Fri Feb 16, 2018 9:57 pm
by Squli
Ponele wrote:COR ? COD? Or Persistent Memory?


I want to get the three types of memory size.

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Fri Feb 16, 2018 10:01 pm
by Squli
Tolice wrote:You can write another applet to get your applet size, as following steps:
- 1, Get card memory size named M1;
- 2, Load your applet to the card and get card memory size named M2;
- 3, Your applet used memory size named M, and M = M1 - M2



Thanks, But how can I get the card memory size?

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Sun Feb 25, 2018 10:03 pm
by Tolice
You can using the function of JCSystem.getAvailableMemory(byte memoryType) to obtains the amount of memory of the specified type.

Re: Is there any way to find out how much memory size has my applet taken up?

Posted: Mon Feb 26, 2018 2:18 am
by javacardx
There are two API functions relating with MEMORY SIZE in following (which is v1 and v2 that copy from package javacard.framework.JCSystem ).

v1:public static short getAvailableMemory(byte memoryType) throws SystemException //javacard 2.2.2
v2:public static void getAvailableMemory(short[] buffer, short offset,byte memoryType)throws SystemException //javacard 3.0 classic