Skip to content

Story memory usage #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AlekseyMelekh opened this issue Apr 16, 2025 · 4 comments · Fixed by #110
Closed

Story memory usage #102

AlekseyMelekh opened this issue Apr 16, 2025 · 4 comments · Fixed by #110

Comments

@AlekseyMelekh
Copy link

Hi. Is there any way to find out the memory usage of 'ink::runtime::story'?

@JBenda
Copy link
Owner

JBenda commented Apr 16, 2025

A story should be similar in size to the story.bin file since it is mainly this plus some pointers as seen here.

For the global and, the runner is currently no function to get the actually used memory.

There is an indirect metric included in config.h. Where you can limit the number of elements per type of list used throughout the code.

Why are exactly you interested in the memory footprint?

@AlekseyMelekh
Copy link
Author

AlekseyMelekh commented Apr 18, 2025

This metric would be useful for gathering statistics on how much resources are consumed by ink::runtime::story

@JBenda
Copy link
Owner

JBenda commented Apr 18, 2025

I see the point, but a precise memory usage is system-dependent, and I do not know how to implement it efficiently.

For a precise measurement, I use valgrind's massif for profiling

A collection of the current size of all dynamic values in the config.h could be collected, to have an idea where the memory is going. This could be implemented.

@JBenda
Copy link
Owner

JBenda commented Apr 29, 2025

In #110 is a inkcpp_cl version which supports the flag --statistics, which will print different array sizes. This will not include the size of allocated strings.

JBenda added a commit that referenced this issue May 13, 2025
Fixes #107
+ implement dynamic growing string_table
+ implement dynamic growing output

Fixes #102
+ implement state function to get current usage and capacity of
structured limits defined in config.h 

Fixes #111
+ store container offsets relative to story instruction start

Fixes #104
+ Check and adopt for compilation with C++17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants