Simple way to check how much heap has been allocated?

Is there a simple way to check how much heap memory has been allocated?

I was wanting to check that my code for removing a potential cycle was working as intended ( I am pretty sure it is, just wanted to confirm it ). I couldn't find a standard function, I guess you could substitute the standard allocator and keep track? Just wonder if there is perhaps a standard easy way to do his without re-inventing it. I remember in C# there is a standard function.

This isn't quite what you asked for, but if you run your tests under miri, then it will tell you if there are any memory leaks.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.