jerryscript-project / jerryscript

Ultra-lightweight JavaScript engine for the Internet of Things.
https://jerryscript.net
Apache License 2.0
6.89k stars 669 forks source link

How to evaluate the heap and stack size needed by my project? #5011

Closed Sherry0901 closed 2 years ago

Sherry0901 commented 2 years ago

Hi! I am using jerryscript in my project. I need to evaluate the memory resources required by my application in order to adjust the hardware resources. Can jerry calculate and show the heap size needed by running a JS file?

zherczeg commented 2 years ago

Yes. There is a jerry_heap_stats API in jerryscript.h. You can also pass --mem-stats on to the command line interpreter to check the values.

Sherry0901 commented 2 years ago

Thanks a lot! That's what I need.