gpt4 book ai didi

c - 如何在 linux 中获取 C 中可用内存的总大小?

转载 作者:IT王子 更新时间:2023-10-29 00:48:46 29 4
gpt4 key购买 nike

在 Java 中它很简单:

Runtime.getRuntime().freeMemory()

如何在 C 中实现?

最佳答案

您可以使用getrlimit() 获取Linux 下进程的虚拟内存限制。使用 RLIMIT_AS 参数。

关于c - 如何在 linux 中获取 C 中可用内存的总大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7382554/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com