JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

How much RAM my applet needs

JavaCard Applet Development Related Questions and Answers.
cprgolds
Posts: 8
Joined: Thu Jan 14, 2016 4:31 am
Points :68
Contact:

How much RAM my applet needs

Post by cprgolds » Tue Jan 17, 2017 11:09 pm

I wonder how much RAM my applet will need. What consumes RAM in my applet? I can count the transient variables but how do I find out how much RAM for the stack I need?

Wardor
Posts: 18
Joined: Tue Nov 10, 2015 4:51 am
Points :114
Contact:

Re: How much RAM my applet needs

Post by Wardor » Wed Jan 18, 2017 5:27 am

What consumes RAM in my applet?

transient variables, the stack,APDU buffer

I can count the transient variables but how do I find out how much RAM for the stack I need?

IMO, JCVM method stack is pre-allocated to a minimum size.
You can try to call the method JCSystem.getAvailableMemory(MEMORY_TYPE_TRANSIENT_RESET) within each method and save it to a shared byte array for output. But the method's parameters will also consume stack memory.

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: How much RAM my applet needs

Post by mabel » Wed Jan 18, 2017 6:21 am

As far as I know, APDU buffer and stack consume pre-allocated RAM.

cprgolds
Posts: 8
Joined: Thu Jan 14, 2016 4:31 am
Points :68
Contact:

Re: How much RAM my applet needs

Post by cprgolds » Thu Jan 19, 2017 12:06 am

Thanks for all the answers. I have tried to call JCSystem.getAvailableMemory(MEMORY_TYPE_TRANSIENT_RESET) to know the approximate memory.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 42 guests

JavaCard OS : Disclaimer