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

Show memory usage of the program on cf test #9

Closed
GaurangTandon opened this issue May 19, 2019 · 8 comments
Closed

Show memory usage of the program on cf test #9

GaurangTandon opened this issue May 19, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@GaurangTandon
Copy link
Contributor

Is it possible to show memory consumption of program alongside the verdicts...

Passed #1 .... 0.002s/192K
Passed #2 .... 0.002s/192K
Passed #3 .... 0.002s/192K
Passed #4 .... 0.030s/10M

and highlight in red if it exceeds the memory limit mentioned on the problem page? I am asking because I recently overran memory by accidentally using a 5000x5000 long long int 2D vector, and got an MLE later.

@xalanq
Copy link
Owner

xalanq commented May 19, 2019

Show memory is OK. But check stuff is not. Because memory limit is fetched by using network, it causes lag.

@GaurangTandon
Copy link
Contributor Author

GaurangTandon commented May 19, 2019

Sorry, I do not understand how fetching memory limit causes network lag? It currently does fetch the test cases for the problem. So, fetching the memory limit value should be quite a trivial addition to that, shouldn't it?

@xalanq
Copy link
Owner

xalanq commented May 19, 2019

Current version doesn't store any contest information. So to get the contest info must be fetched online. Yeah, the contest info should be stored in local, and there are many things to consider. But you need to wait some time (I'm busy)~

@xalanq xalanq added the enhancement New feature or request label May 19, 2019
@xalanq
Copy link
Owner

xalanq commented May 19, 2019

I found getting memory usage in windows is a little bit hard :(

@GaurangTandon
Copy link
Contributor Author

But you need to wait some time

Sure, take your time :)

@VincentXWD
Copy link

VincentXWD commented Jun 10, 2019

One possible way to implement this feature is to use ulimit: https://ss64.com/bash/ulimit.html
You can set the memory limit crawled by your crawler and do the corresponding limit before running your program.
This tool can be used on Linux and OSX. As for a equivalent on Windows, check this: https://serverfault.com/questions/133122/ulimit-for-windows

@xalanq
Copy link
Owner

xalanq commented Jul 16, 2019

I'm trying https://github.com/shirou/gopsutil
It seems working.

@xalanq
Copy link
Owner

xalanq commented Jul 16, 2019

Done~ I'll release it later, because the GIF should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants