原创文章,转载请注明出处: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. 前端设计的常用属性,CSS的盒模型,页面布局的利器

    在CSS和HTML结合布局页面的过程中,有一组被人们称为“盒属性”的CSS样式,被广泛的使用到.相信经常布局写页面的朋友们对盒属性一定不陌生.在CSS技术的发展过程中,盒属性也有了许多次改进,今天小编 ...

  2. Python的网络编程[1] -> FTP 协议[2] -> 使用 ftplib 建立 FTP 客户端

    使用 ftplib 建立 FTP 客户端 用于建立FTP Client,与 pyftplib 建立的 Server 进行通信. 快速导航 1. 模块信息 2. 建立 FTP 客户端 1. 模块信息 1 ...

  3. view hex value in MR

    cat filename | hexdump  –C tail  -行数 filename | hexdump  –C head -行数 filename | hexdump -C

  4. Find the Duplicate Number -- LeetCode

    Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), pro ...

  5. SQL使用链接服务器执行远程数据库上的存储过程

    原文:SQL使用链接服务器执行远程数据库上的存储过程 --创建链接服务器 exec sp_addlinkedserver'server_tmp','','SQLOLEDB','远程服务器名或ip地址' ...

  6. flask的session解读及flask_login登录过程研究

    #!/usr/bin/env python # -*- coding: utf-8 -*- from itsdangerous import URLSafeTimedSerializer from f ...

  7. Android.mk入门(一)

    Android.mk是Android工程管理文件,其作用基本等同于Linux环境中的Makefile,在语法上,Android.mk和普通Makefile略有不同,主要区别是Android.mk包含一 ...

  8. MVC EasyUI 时间格式化

    用 return Json(dr, JsonRequestBehavior.AllowGet);  会返回一个json 数据格式,在用 EasyUI 输出表格内容时会遇到时间输出不是我们想要的格式, ...

  9. [ElasticSearch]Java API 之 词条查询(Term Level Query)

    1. 词条查询(Term Query)  词条查询是ElasticSearch的一个简单查询.它仅匹配在给定字段中含有该词条的文档,而且是确切的.未经分析的词条.term 查询 会查找我们设定的准确值 ...

  10. 【HTML 元素】嵌入图像

    img元素允许我们在HTML文档里嵌入图像. 要嵌入一张图像需要使用src和alt属性,代码如下: <img src="../img/example/img-map.jpg" ...