原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface
, and some of the hidden data I mentioned was missing.
 If you want the total amount of memory owned by the virtual machine, as in the amount that will trip system limits (ulimit), this value is more difficult to get from within the VM.
 If you want the data without calling top or htop, you have to dig down into the VM’s memory allocators to find things out12.

(refc binaries,详细的可见坚强2002博客 - Sunface),和一些我没有提及到的隐藏数据。
 假设你想得到VM在操作系统占用的总内存,这个值在訪问系统的限制下(ulimit),非常难从VM内部获得。
 假设你想不调用top或htop命令来得到数据,你就不得不深入VM内存管理分配来找到你想要的12。 Fortunately, recon has the function recon_alloc:memory/1 to figure it out, where the argument is:
 • used reports the memory that is actively used for allocated Erlang data;
 • allocated reports the memory that is reserved by the VM. It includes the memory used, but also the memory yet-to-be-used but still given by the OS. This is the amount you want if you’re dealing with ulimit and OS-reported values.
 • unused reports the amount of memory reserved by the VM that is not being allocated. Equivalent to allocated-used.
 • usage returns a percentage (0.0 .. 1.0) of used over allocated memory ratios. There are additional options available, but you’ll likely only need them when investigating memory leaks in chapter 7 只是。非常幸运的是。recon有一个函数:recon_alloc:memory/1能够解决上述问题,參数例如以下:
      used:给Erlang data分配的内存 

      allocated:VM占用的总内存。它包括已使用的内存。也包括还已由OS分配给VM但尚未被分配的内存。假设你在处理ulimit和

OS-reported的值,这个參数就非常实用。

      unused:OS分配给VM可是尚未被VM分配的那部分内存。

usage:返回各个功能使用内存的百分比。另一些额外的选项,只是你可能仅仅会在第七章的内存泄漏那里使用。

[11] See Section 7.2
[12] See Section 7.3.2[注11]:參见章节7.2
[注12]:參见章节7.3.2

[Erlang危机](5.1.1)内存的更多相关文章

  1. Erlang 虚拟机 BEAM 指令集之内存管理相关的指令

    翻看 BEAM 虚拟机指令集的时候(在编译器源码目录下:lib/compiler/src/genop.tab),会发现有一些和内存分配/解除分配相关的指令,如下所示: allocate StackNe ...

  2. [Erlang危机](5.1.0)VM检测概述

    原创文章.转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface 把执行指标储存在VM的内存中.能够指定是全局的还是app所特有的. • vms ...

  3. [Erlang危机](4.5)第四章练习

    原创文章.转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface 联系邮箱:cto@188.com Exercises 练习 Review Qu ...

  4. [Erlang危机](5.1.3)进程

    原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface 联系邮箱:cto@188.com Processes Trying to ge ...

  5. [Erlang危机](4.1)作业控制模式

    原创文章,转载请注明出处:服务器非业余研究http://blog.csdn.net/erlib 作者Sunface 联系邮箱:cto@188.com Job Control Mode 作业控制模式 T ...

  6. [Erlang危机](5.1.4)端口port

      原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface 或port drivers15.   全程跟踪端口数会对诊断负载或进程泄漏 ...

  7. [Erlang危机](4.2)Remsh

    原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface 联系邮箱:cto@188.com Remsh There's a mechan ...

  8. [Erlang危机](5.0)执行时指标

    原创文章.转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface .  Then, in times of need, it's also po ...

  9. [Erlang危机](4.4)命名管道

    原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface . .To connect to the node, you use the ...

随机推荐

  1. BZOJ1588 [HNOI2002]营业额统计 splay模板

    1588: [HNOI2002]营业额统计 Time Limit: 5 Sec  Memory Limit: 162 MB Submit: 16189  Solved: 6482 [Submit][S ...

  2. AC日记——奶牛集会 洛谷 P2345

    奶牛集会 思路: 把奶牛按照v排序: 然后,每次都把奶牛放入一个集合s: 因为奶牛已经排序: 所以,每次第i次放入奶牛起作用的v就是vi: 每次ans+=(xi*sum-sumxl)*vi+(sumx ...

  3. 小程序收集formid跳转后收集不到

    为了突破微信小程序模板消息限制,需收集到足够的推送码,即每次提交表单时获取到的formId.一个formId代表着开发者有向当前用户推送模板消息的一次权限.当表单组件中的属性report-submit ...

  4. Spfa【p1186】 玛丽卡

    Description 麦克找了个新女朋友,玛丽卡对他非常恼火并伺机报复. 因为她和他们不住在同一个城市,因此她开始准备她的长途旅行. 在这个国家中每两个城市之间最多只有一条路相通,并且我们知道从一个 ...

  5. 数值计算方法 | C语言实现几个数值计算方法(实验报告版)

    目录 写在前面 实验一 牛顿插值方法的实现 实验二 龙贝格求积算法的实现 实验三 高斯列主元消去法的实现 实验四 最小二乘方法的实现 写在前面 使用教材:<数值计算方法>黄云清等编著 科学 ...

  6. Chrome插件开发教程收集

    教程: http://open.chrome.360.cn/extension_dev/overview.html http://www.cnblogs.com/liuxianan/p/chrome- ...

  7. 关于spring.net的面向切面编程 (Aspect Oriented Programming with Spring.NET)-通知(Advice)API

    本文翻译自Spring.NET官方文档Version 1.3.2. 受限于个人知识水平,有些地方翻译可能不准确,但是我还是希望我的这些微薄的努力能为他人提供帮助. 侵删. 让我们看看 Spring.N ...

  8. 慎用SELECT INTO复制表

    原文:慎用SELECT INTO复制表 很多时候我们习惯于用SELECT INTO复制一个表或表结构,因为它方便,快捷,而且在某些情况下效率比INSERT INTO 效率要高一些.但是要注意: SEL ...

  9. Linux下防止文件误删方法

    转载:http://coolsky.blog.51cto.com/177347/1230332 Linux系统中,在root帐号下使用rm * -rf是非常危险的,一不小心就可能删除系统中的重要文件. ...

  10. 在K8s中创建StatefulSet

    在K8s中创建StatefulSet 遇到的问题: 使用Deployment创建的Pod是无状态的,当挂在Volume之后,如果该Pod挂了,Replication Controller会再run一个 ...