原创文章,转载请注明出处: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. 小谈android/Linux rootkit(基于LKM)

    最近又学习了一下,感觉还有好多东西不知道,以后积累多一点再从新写一个. 在android上捣鼓了一下linux的内核rootkit,虽然中途遇到了无数坑,至今也没有完全写完,打算先好好啃一段时间lin ...

  2. 浅析 Node.js 单线程模型

    总结笔记:对于每个用户请求,由主线程接收并存放于一个事件队列中(不做任何处理),当无请求发生时,即主线程空闲,主线程开始循环处理事件队列中的任务: 对于非阻塞JS程序: 1.若某事件需要I/O操作,则 ...

  3. oracle free space

    --Size of All Table Space --1. Used Space SELECT TABLESPACE_NAME,TO_CHAR(SUM(NVL(BYTES,0))/1024/1024 ...

  4. [BZOJ 1037] 生日聚会Party

    Link: BZOJ 1037 传送门 Solution: 由于对任意一段都有要求,于是我们对于所有前缀考虑其后缀不超过$k $即可: 设$dp[i][j][x][y]$为前$i$个人中有$j$个男孩 ...

  5. 二分图变种之最小路径覆盖、最小点覆盖集【poj3041】【poj2060】

    [pixiv] https://www.pixiv.net/member_illust.php?mode=medium&illust_id=54859604 向大(hei)佬(e)势力学(di ...

  6. Maven创建多模块项目(包括依赖版本号的统一更新)

    0.多项目工程的文件夹及依赖关系 bus-core-api为公共项目,app-web-ui依赖bus-core-api,app-desktop-ui依赖bus-core-api 1.创建一个父Mave ...

  7. Jackson反序列化提示:Can not deserialize instance of Task out of START_ARRAY token

    解决方法: 1.没有绝对的方法,只能不断的测试和排查. 2.检查一下JSON数据和实体的字段结构是不是不一致导致的.比如JSON数据是数组,而实体字段为非数组. 参考: https://stackov ...

  8. 细说JavaScript对象(4): for in 循环

    如同 in 运算符一样,使用 for in 循环遍历对象属性时,也将往上遍历整个原型链. // Poisoning Object.prototype Object.prototype.bar = 1; ...

  9. GTK+重拾--09 GTK+中的组件(一)

    (一):写在前面 在这篇文章中主要介绍了GTK+程序中的各种构件,这是解说构件的第一个部分,另外一部分将在下一个小节中讲到. 构件是建立一个GUI程序的基础.在GTK+的长期发展过程中.一些特定的构件 ...

  10. 关于String的两种赋值方式

    String的两种赋值是不同的,String str1=“hello”,指向堆内存中的"hello",而String str2=new String("hello&quo ...