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

内存进制转换问题 #30

Open
symbioticstar opened this issue Jun 6, 2019 · 3 comments
Open

内存进制转换问题 #30

symbioticstar opened this issue Jun 6, 2019 · 3 comments

Comments

@symbioticstar
Copy link

runner.c line 111
_result->memory = resource_usage.ru_maxrss * 1024;
根据 http://man7.org/linux/man-pages/man2/getrusage.2.html
maxrss应为kilobytes
根据 SI 1kilobytes = 10^3 bytes
这里使用1024是否准确

@mjiuming
Copy link

mjiuming commented Nov 14, 2019

同样有这个问题,参考wikipedia给出的解释

This article is about the SI unit of 1000 bytes. For the binary unit of 1024 bytes, see kibibyte.
"KByte" redirects here. For the battery electric car from Future Mobility Corporation, see Byton K-Byte.

这里应该使用1000而不应该是1024

@drabbit75
Copy link

This article is about the SI unit of 1000 bytes. For the binary unit of 1024 bytes, see kibibyte.
"KByte" redirects here. For the battery electric car from Future Mobility Corporation, see Byton K-Byte.

如果确实,应该在代码中更正

@shankerwangmiao
Copy link

见:https://github.com/torvalds/linux/blob/f75aef392f869018f78cfedf3c320a6b3fcfda6b/kernel/sys.c#L1793

实际上是文档错误,maxrss 的单位应该是 1024 字节,也就是 KiB。

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

No branches or pull requests

4 participants