Skip to content

Track peak memory usage#11

Open
PyXiion wants to merge 3 commits intotzcnt:mainfrom
PyXiion:main
Open

Track peak memory usage#11
PyXiion wants to merge 3 commits intotzcnt:mainfrom
PyXiion:main

Conversation

@PyXiion
Copy link

@PyXiion PyXiion commented Feb 19, 2026

From #10

While running benchmarks, I encountered an unexpected and massive spike in memory consumption. Some libraries hit nearly 28 GiB of RAM, bringing my system almost to death. Luckily, I managed to kill the process just in time.

I think memory usage tracking will be very useful.

Additionally, it would be helpful to add a warning in the README to alert users about potential high memory usage.

Roughly what the table will look like

Runtime libfork TooManyCooks TooManyCooks_st_asio TooManyCooks_mt libcoro libcoro_mt cobalt_st_asio cobalt
skynet 15.97 MB 15.97 MB N/A N/A 20.62 GB N/A N/A N/A
nqueens 15.97 MB 15.97 MB N/A N/A 5.37 GB N/A N/A N/A
fib(39) 15.97 MB 15.97 MB N/A N/A 17.02 GB N/A N/A N/A
matmul(2048) 59.66 MB 57.09 MB N/A N/A 60.93 MB N/A N/A N/A
io_socket_st N/A 15.97 MB N/A N/A 15.97 MB N/A N/A 16.1 MB
channel N/A N/A 28.76 MB 31.39 MB N/A 15.97 MB 15.54 MB N/A

@tzcnt
Copy link
Owner

tzcnt commented Feb 22, 2026

I see this is still in draft status. I was able to run and get memory statistics on Linux (which I'll update the README with). So I think it's pretty much ready. Thanks for showing me about these OS APIs, it's very helpful to know.

On Windows I had to swap the order in memusage.hpp so #include <windows.h> comes before #include <psapi.h> so if you don't mind swapping that I'd be happy to merge this. There are some other unrelated build issues on Windows but those are on me to resolve.

@PyXiion
Copy link
Author

PyXiion commented Feb 22, 2026

I want to make memory stats in the graph too, but I think I'll implement this a bit later.

I have no Windows machine, so I wrote implementation based on docs. I think CI wouldn't harm to add later

@PyXiion PyXiion marked this pull request as ready for review February 24, 2026 06:40
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 this pull request may close these issues.

2 participants