Skip to content
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

Add capability to check memory usage within the code #2070

Open
Kouteki opened this issue May 10, 2024 · 3 comments
Open

Add capability to check memory usage within the code #2070

Kouteki opened this issue May 10, 2024 · 3 comments

Comments

@Kouteki
Copy link
Contributor

Kouteki commented May 10, 2024

          If it's possible to pull various data from the `Machine`, how about creating a package like `runtime`? I think it would be useful if we could directly check the memory usage by using `Alloc` field including gas usage, within the code.

type Allocator struct {
maxBytes int64
bytes int64
}

Originally posted by @notJoon in #1998 (comment)

@thinhnx-var
Copy link
Contributor

Can I assume that you suggests a feature that realm developers are able to check the amount that will be allocated in memory of the data, and how much it does cost in gas ? If I was right I will implement this feat as I am currently doing the GasUsed() funtions ✋
@notJoon

@notJoon
Copy link
Member

notJoon commented May 21, 2024

Can I assume that you suggests a feature that realm developers are able to check the amount that will be allocated in memory of the data, and how much it does cost in gas ? If I was right I will implement this feat as I am currently doing the GasUsed() funtions ✋ @notJoon

Yes, I think it would be good to show them together because the gas usage has some correlation with memory usage and vice versa. However, my intention was to make the foundation for measuring code performence like Go's pprof and prove better metrics to optimize code efficiently. So in my opinion it would better to implement them individually.

@thinhnx-var
Copy link
Contributor

Ok I understand your intention. I gonna implement this good idea within std package first.
Many thanks @notJoon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants